Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] webmail now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as C++ by bunkar ( 14 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

Your Name: Code Language: