template mem fun problem gcc-3.0.2

Neal D. Becker nbecker@fred.net
Fri Feb 1 10:27:00 GMT 2002


>>>>> "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?



More information about the Gcc-help mailing list