fork download
  1. #include <iostream>
  2. template<typename Lhs, typename Rhs>
  3. struct Match
  4. {
  5. static const bool Value = false;
  6. };
  7. template<typename T>
  8. struct Match<T, T>
  9. {
  10. static const bool Value = true;
  11. };
  12. template<typename T>
  13. struct IsUS
  14. {
  15. static const bool Value = Match<T, unsigned short int>::Value;
  16. };
  17. template<typename T>
  18. struct IsUL
  19. {
  20. static const bool Value = Match<T, unsigned long int>::Value;
  21. };
  22. template<typename T>
  23. struct IsSS
  24. {
  25. static const bool Value = Match<T, signed short int>::Value;
  26. };
  27. template<typename T>
  28. struct IsSL
  29. {
  30. static const bool Value = Match<T, signed long int>::Value;
  31. };
  32. template<typename T>
  33. struct IsInt
  34. {
  35. static const bool Value = IsUS<T>::Value || IsUL<T>::Value || IsSS<T>::Value || IsSL<T>::Value;
  36. };
  37. int main()
  38. {
  39. std::cout << std::boolalpha;
  40. std::cout << IsInt<int>::Value;
  41. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
false