template int foo::encode(const T& t) { return 0; } template <> int foo::encode(bar& t); // another file calls encode(bar{})