This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs support for local classes as template arguments
- To: egcs at cygnus dot com
- Subject: Re: egcs support for local classes as template arguments
- From: Mumit Khan <khan at xraylith dot wisc dot edu>
- Date: Wed, 17 Dec 1997 14:49:57 -0600
- Reply-To: egcs at cygnus dot com
Don Waugaman <dpw@cs.arizona.edu> writes:
>
> The workaround is obvious - move the class definition outside the function -
> and it works, but I was wondering if the use of local classes as template
> arguments would be fixed any time soon.
How about never ;-) This is illegal code, so will never be "fixed". I
had to convert some old code where I made the same mistake and didn't
realize it until the newer compilers started rejecting it. See DWP sec
14.8 "Template Arguments" for the rules; for a discussion, dig out the
thread in comp.std.c++ (using http://www.dejanews.com) about 2 years ago
titled "local type not allowed as template arg" (specifically look for
the explanation by Steve Clamage).
Mumit