#include #include using namespace std; template inline void f5(); template class wrapper { const T t; public: wrapper(const T& initial_t = T()): t(initial_t) {} friend void f1() {cout << "f1(): " << sizeof wrapper().t << "\n";} friend void f2(); friend void f3(const T& arg) { cout << "f3(const T&): " << sizeof wrapper().t << "\n"; } friend void f4(const T& arg); friend void f5(); template friend void f6(); }; inline void f2() {cout << "f2(): " << sizeof wrapper().t << "\n";} template class wrapper; inline void f4(const char& arg) { cout << "f4(const char&): " << sizeof wrapper().t << "\n"; } template class wrapper; inline void f4(const int& arg) { cout << "f4(const int&): " << sizeof wrapper().t << "\n"; } template inline void f5() {cout << "f5(): " << sizeof wrapper().t << "\n";} template inline void f6() {cout << "f6(): " << sizeof wrapper().t << "\n";} int main() { f1(); f2(); f3(10); f4('A'); f4(10); f5(); f6(); return EXIT_SUCCESS; }