This is the mail archive of the gcc-bugs@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: "redefinition" of template default argument causes error on egcs 1.1b (no error on 2.8.1)




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


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