#include #include using namespace std; template void g(); template class wrapper { const T t; public: wrapper(const T& initial_t = T()): t(initial_t) {} friend void f() {cout << wrapper().t << "\n";} friend void g() {cout << wrapper().t << "\n";} template friend void h() {cout << U(wrapper().t) << "\n";} }; //template class wrapper; //explicit instantiation int main() { wrapper w; //implicit instantiation //wrapper w2; cout << boolalpha << fixed; f(); g(); h(); h(); return EXIT_SUCCESS; }