This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project. See the libstdc++ home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: Static data members in template declarations



On Nov  2, 1998, Mark Mitchell <mark@markmitchell.com> wrote:

> Martin suggests that we should delay checking whether or not the array
> is the same array until instantiation time.

I was trying to suggest that too, but I couldn't find the right words.

>   template <class T> struct S { void f(T*); };
>   template <class T> void S<T>::f(typename T::X) {}

> Should we wait to figure out whether this the same `f' until we
> instantiate S, and determine whether or not T::X is the same as T*?
  
I don't think so, but this is also different from the original
example.  There, `a' was a member of the template, so there was no
doubt it would always have the same meaning.  In all the other cases
you have presented, they all really depended on the template
arguments.  I don't know how hard it would be to make this distinction 
at template-definition-time, but I can't see how different it is from
delaying name resolution to template instantiation time...

Anyway, we are probably not going to convince each other in this
issue, so we'd better try to get opinions from a wider audience.  How
about posting the three examples to comp.std.c++?

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:oliva@gnu.org mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil