More test results...

Martin Sebor sebor@roguewave.com
Fri Mar 15 10:26:00 GMT 2002


Benjamin Kosnik wrote:
> 
> > Apologies for intruding on this discussion, but I thought the change
> > was actually pretty cool until I realized that it prevents the explicit
> > specialization of the individual data members of the primary template
> > inherited from the base.
> 
> Que? Can you post code that demonstrates this, as I'm not quite sure what
> you mean. Did you see the example here:
> 
> http://gcc.gnu.org/ml/libstdc++/2002-03/msg00237.html

I could have missed something, so feel free to ignore me if I'm off base.
This should (and does) work:

    template <class T>
    struct B { static const int j = 0; };

    template <class T>
    const int B<T>::j;

    template <>
    const int B<void>::j = 2;

but this can't:

    struct A { static const int j = 0; };

    const int A::j;

    template <class T>
    struct B: A { };

    template <>
    const int B<void>::j = 2;

Martin



More information about the Libstdc++ mailing list