Paste
Pasted as C++ by bunkar ( 16 years ago )
//Разрешение типов:
template<typename T> void allow_type(const T &t);
template<> void allow_type<int>(const int &t) {}
// Использование
template<typename T>
void f(T t)
{
allow_type(t);
std::cout << t;
}
int main()
{
f(4);
f(3.5);
}
Revise this Paste