Emanuel Ziegler <[EMAIL PROTECTED]> writes:

> On Fri, 02 Dec 2005 17:53:13 +0100 Maurizio Loreti wrote:
>
>> well, the diagnostic is clear; g++ needs a prototype in scope of the
>> function to be declared friend.
>
> Ok, that works. Thanks! But why does it apply to templates only?

The moral equivalent of the non-template code you haven't shown us would be:

template <class T>
class FriendClass
{
  template <typename U>
  friend U get_test (const FriendClass<U> &);
};

which gcc 4.x happily accepts; the template get_test is implicitly
declared in the namespace to which FriendClass belongs. But it
declares *all* specializations of get_test() to be friends of all
specialziations of FriendClass.


Your code attempts to use a specialization of a so far undeclared
template.
_______________________________________________
Help-gplusplus mailing list
Help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to