1234567891011121314151617181920
class A { template<typename N> friend class B<N>; void foo() { } }; template<typename T> class B { public: void foo2(A a) { a.foo(); //error says "private 'A::foo()' is inaccessible" } };
12
template<typename N> friend class B<N>;