BigMan wrote:
Well, your code does not compile in my g++ 3.4.2. The problem is:
error: `T' is neither function nor member function; cannot be declared
friend
I don't know about g++ 3.4.2 but Comeau C++ (online trial) refuses to
compile
template<class T> class A {
friend class T;
int a;
};
explaining that 'T' "may not be used in an elaborate type specifier",
although I can't find anything against it in the Standard. [Aside:
it would really be nice if compilers in the cases where they give
diagnostic messages re ill-formed code, supplied at least the clause
of the Standard related to the issue, better if it were the paragraph]
It would be nice if somebody more versed in the Standard explained...
V