1
2
3
4
5
6
7
8
template <typename T> int foo::encode(const T& t) {
    return 0;
}

template <> int foo::encode<bar>(bar& t);

// another file calls encode(bar{})