TITLE: nested friend template classes and functions (Newsgroups: comp.std.c++) PROBLEM: Bernd Anhaeupl Look at 14.12 of the (public) draft. There is an explicit example of friend templates: class A { template friend B; //ok template friend void f(T); //ok template friend BB { /* ... */ } // error template friend void ff(T) { /* ... */ } // error }; So you can declare a friend template of a class but you must not define it inside the class. RESPONSE: jason@cygnus.com (Jason Merrill), 13 Jun 96 That has changed in the current (May) draft: 2 A friend template may be declared within a non-template class. A friend function template may be defined within a non-template class. In these cases, all specializations of the class or function template are friends of the class granting friendship. [Example: class A { template friend class B; // ok template friend void f(T){ /* ... */ } // ok }; --end example]