explicit-instantiation.cpp [plain text]
template<typename T, typename U, typename Result>
struct plus {
Result operator()(const T& t, const U& u) const;
};
template<typename T, typename U, typename Result>
Result plus<T, U, Result>::operator()(const T& t, const U& u) const {
return t + u;
}
template struct plus<int, long, long>;
template <typename T> struct S {
void f();
static void g();
static int i;
struct S2 {
void h();
};
};
template void S<int>::f();
template void S<int>::g();
template int S<int>::i;
template void S<int>::S2::h();
template <typename T> void S<T>::f() {}
template <typename T> void S<T>::g() {}
template <typename T> int S<T>::i;
template <typename T> void S<T>::S2::h() {}