"redefinition" of template default argument causes error on egcs 1.1b (no error on 2.8.1)
Mark Mitchell
mark@markmitchell.com
Tue Sep 8 20:53:00 GMT 1998
You wrote:
template<typename T=int> struct cow; //forward declaration
template<typename T=int> struct cow { T data; };
>From the standard:
12A template-parameter may not be given default arguments by two differ-
ent declarations in the same scope. [Example:
template<class T = int> class X;
template<class T = int> class X { /*... */ }; // error
--end example]
--
Mark Mitchell mark@markmitchell.com
Mark Mitchell Consulting http://www.markmitchell.com
More information about the Gcc-bugs
mailing list