This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: "redefinition" of template default argument causes error on egcs 1.1b (no error on 2.8.1)
- To: kosak at cs dot cmu dot edu
- Subject: Re: "redefinition" of template default argument causes error on egcs 1.1b (no error on 2.8.1)
- From: Mark Mitchell <mark at markmitchell dot com>
- Date: Tue, 8 Sep 1998 20:55:14 -0700
- CC: egcs-bugs at cygnus dot com
- References: <199809081938.MAA07195@cygnus.com>
- Reply-to: mark at markmitchell dot com
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