Hello, I have some code that works when I make class classA public. But I only want class classA to be accessible by itself and class classB. So the problem is very concrete: make classB a friend of classA. Here is the code that describes both classes. template <class T, int C> class classA; template <class T, int C, classA<T,C> &instanceA> class classB; template <class T, int C> class classA { template <classA &instanceA> friend class classB; private: int for_use_by_classB; }; template <class T, int C, classA<T,C> &instanceA> class classB { classB (int i) { instanceA.for_use_by_classB = i; } }; // instantiation gives error // template class classA<char,128>; -- View this message in context: http://old.nabble.com/class-does-not-want-to-get-friends-with-another-class-tp29910278p29910278.html Sent from the gcc - Help mailing list archive at Nabble.com.