TITLE: class template friend declaration syntax (Newsgroups: comp.lang.c++.moderated, 13 Feb 98) GUERVOS: jmerelo@kal-el.ugr.es (J.J. Merelo Guervos) Hi, I have been looking everywhere, and can't find a solution to this: How should a class template be declared as a friend? 1. template friend class A; 2. friend template class A; [snip] VANDEVOORDE: David Vandevoorde It should be: 3. template friend class A; Note that you cannot designate a partial specialization to be a friend (which is kind of what your syntax implies). The declaration above also grants access to partial specializations and (full) specializations. OTOH, you _can_ designate a (full) specialization of a class template to be a friend... but them it's no longer a template. E.g., 4. friend class A; Friend function template declarations are much more "interesting" ;-)