template<class T>
struct is_void; T是否为void类型
template<class T>
struct is_enum; T是否为枚举类型
template<class T>
struct is_union; T是否为union类型
template<class T>
struct is_class; T是否为class/struct类型而不是union类型
template<class T>
struct is_function; T是否为函数类型
template<class T>
struct is_reference; T是否为引用类型
template<class T>
struct is_arithmetic; T是否为整型、浮点类型
template<class T>
struct is_fundamental; T是否为整型、浮点、void或nullptr_t类型
template<class T>
struct is_object; T是否为一个对象类型(不是函数、不是引用、不是void)
template<class T>
struct is_scalar; T是否为arithmetic、enumeration、pointer、pointer to member或nullptr_t类型
template<class T>
struct is_compound; T是否非fundamental类型构造的
template<class T>
struct is_member_pointer; T是否为成员函数指针类型
template<class T>
struct is_polymorphic; T是否有虚函数
template<class T>
struct is_abstract; T是否为抽象类
template<class T>
struct is_signed; T是否是有符号类型
template<class T>
struct is_unsigned; T是否是无符号类型
template<class T>
struct is_const; T是否为const修饰的类型
使用如下:
cout << is_const<const int*>::value << endl; //0
cout << is_const<int* const>::value << endl; //1
template<class T, class U>
struct is_same; 判断两个类型是否相同
template<class Base, class Derived>
struct is_base_of; 判断Base类型是否为Derived类型的基类
template<class Form, class To>
struct is_convertible; 判断前面的模板参数类型能否转换为后面的模板参数类型