inline template not expanded.
Jason Merrill
jason@cygnus.com
Thu Oct 9 09:50:00 GMT 1997
>>>>> Alexandre Oliva <oliva@dcc.unicamp.br> writes:
>> template<class T>
>> class w {
>> // Problem with this friend declaration. Removing it fix the problem
>> friend str& operator<<(str&, const w<T>&);
> // note the angle brackets indicating a template function whose
> // arguments can be deduced from the argument list:
> friend str& operator<< <>(str&, const w<T>&);
> // the template argument could have been given explicitly:
> // friend str& operator<< <T>(str&, const w<T>&);
And if you need the overloading effect of a guiding decl, you can write
friend str& operator<<(str &x, const w<T> &y)
{ return operator<< <> (x, y); }
Jason
More information about the Gcc-bugs
mailing list