







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








template< class U >void template< class U > void doSomethingdoSomething( U u ) {( U u ) { B< U > ib;ib.data = 78; B< U > ib; ib.data = 78; } }
class B< int > { class B< int > {int data; int data; friend void doSomething( int );friend A< int >; friend void doSomething( int ); friend A< int >; }; }; docsity.com
template< class T >class A { template< class T > class A { void method() { void method() {B< char > cb; B< char > cb; // OK!// OK! cb.data = 8;B< int > ib; cb.data = 8; B< int > ib; } } ib.data = 9;^ ib.data = 9; }; }; docsity.com
template< class T >class B { template< class T > class B { T data;template< class U > T data; template< class U > }; }; friend class A;^ friend class A;
template< class U >void doSomething( U u ) { template< class U > void doSomething( U u ) { B< int > ib;ib.data = 56; B< int > ib; ib.data = 56; // OK// OK } }