"ben" <be******@hotmail.com> wrote in message
news:42**********************@news.optusnet.com.au
template <typename T>
class A
{
friend class T; // error, but why?
};
Because the C++ standard says so.
http://groups-beta.google.com/group/...8a87917621b61e
Presumably allowing it to compile creates problems in some cases (or makes
the compiler harder to write), though I can't help with the details on this.
It may be noted that for some T the friend declaration would not make sense,
e.g., friend class int; This may (or may not) have some relevance.
--
John Carson