//Разрешение типов:
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);
}

Add a code snippet to your website: www.paste.org