Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so dont bother with any of their useless mail servers here and just use oauth login instead. Thank the nice Russians for causing that. :)

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

Your Name: Code Language: