This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]