This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Parse error with member templates
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: gcc at gcc dot gnu dot org
- Cc: patrick at 137 dot org
- Date: Wed, 18 Sep 2002 17:44:01 -0500 (CDT)
- Subject: Re: Parse error with member templates
- Organization: Networks and Infrastructure Lab (IL02/2240), Motorola Labs
In article <3D88FAF9.4010705@137.org> you write:
> SGI's MIPSpro Compilers 7.3.1.3m compiles the code fine, and so does MS
> Visual C++ 7 (!). Most of the time, GCC 3.x blows both of these out of
> the water, and thus my surprise when I got the above error. I couldn't
> find a PR relating to this, so I am wondering if this is this a known
> problem.
Just because another compiler compiles your code, that doesn't make
them better (just less up-to-date with the standard, in this case ;-)
Try this implementation of B<T>::toString():
std::string toString() const
{
return mObj.template getValue<std::string>();
}