template <class T> struct is_floating_point;
123456789101112
// is_floating_point example #include <iostream> #include <type_traits> int main() { std::cout << std::boolalpha; std::cout << "is_floating_point:" << std::endl; std::cout << "int: " << std::is_floating_point<int>::value << std::endl; std::cout << "float: " << std::is_floating_point<float>::value << std::endl; std::cout << "const double: " << std::is_floating_point<const double>::value << std::endl; return 0; }
is_floating_point: int: false float: true const double: true