This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: template mem fun problem gcc-3.0.2
- From: nbecker at fred dot net (Neal D. Becker)
- To: Paolo Carlini <pcarlini at unitus dot it>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 01 Feb 2002 13:27:15 -0500
- Subject: Re: template mem fun problem gcc-3.0.2
- References: <3C5AD5DF.7A6126EA@unitus.it>
>>>>> "Paolo" == Paolo Carlini <pcarlini@unitus.it> writes:
>> This code gives a syntax error. I think it should not.
Paolo> ... and what should give instead, in your opinion??
I may be mistaken, but I thought that the for a template function
template<typename T, typename W>
T f (W);
You say:
X x = f<X> (w) in order to specify the particular template
instantiation. So I thought for a member function it is the same.
class C {
template<typename T, typename W>
T f (W);
};
C c;
X x = c.f<X> (w)
Is this not correct? If it is correct, isn't my code correct and
should not give any error?