fork download
  1. #include <iostream>
  2.  
  3. bool is_int(int) { return true; }
  4.  
  5. template<typename T>
  6. bool is_int(T) { return false; }
  7.  
  8. int main() {
  9. std::cout << std::boolalpha <<
  10. is_int(1) << '\n' <<
  11. is_int(1.0) << '\n' <<
  12. is_int('1') << std::endl;
  13. }
Success #stdin #stdout 0s 4436KB
stdin
Standard input is empty
stdout
true
false
false