On Fri, Feb 11, 2005 at 01:53:23PM -0800, Jan Reimers wrote:
> Can someone verify that this is valid C++ before I submit a bug report:
> 
> // test.C
> template <class T> class A {static T* c;};
> 
> class B : public A<B> {};
> 
> B* A<B>::c=0;
> // end test.C

It's not valid (though a number of compilers have accepted it in the
past); for template specializations you need template<>, and your
definition of A<B>::c is a specialization.

Instead write

template<>
B* A<B>::c = 0;


Reply via email to