template< typename T > struct Test { T t; int f() { return 1; } int g() { return t.g(); } }; struct A { int g() { return 2; } }; struct B { }; int main( void ) { Test< A > a; Test< B > b; a.f(); a.g(); b.f(); return 0; }