// Build don't link: template struct Foo { }; template struct BT { }; template struct BT< Foo, Foo > { static const int i = 1; }; template struct BT< T1, Foo > { static const int i = 2; }; template struct BT< Foo, T2 > { static const int i = 3; }; template int foo(Foo, Foo) { return 1; } template int foo(T1, Foo) { return 2; } template int foo(Foo, T2) { return 3; } void f() { BT< double, Foo >::i; BT< Foo, Foo >::i; BT< Foo, float >::i; foo(1.0, Foo()); foo(Foo(), Foo()); foo(Foo(), 1.0); }