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:

> Concretely, consider this:

> const int a = 7;
> template<class T> struct S : public T { int j [S<T>::a]; int k [a]; };
> struct U { static const int a = 3; };

> Now, in `S<U>', `S<U>::a' is 3 while `a' is 7.

But this is completely different from the previous example.  In that
example, a was declared within the template class, so it couldn't
possibly be bound to names outside the template class body.

-- 
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