#ifndef CLASS_TEMPLATE_3 #define CLASS_TEMPLATE_3 template class ClassTemplate1; //this is a friend class of ClassTemplate1 where //it's T is the same T as this T, //A new copy of this class will be created for every type T template class ClassTemplate3 { public: T m_Data2; void f8(); private: }; template void ClassTemplate3::f8() { cout << "Its Great to be a friend" << endl; ClassTemplate1 I; I.m_Data = 7; I.m_Int = 14; } #endif