23 General utilities library [utilities]

23.15 Metaprogramming and type traits [meta]

23.15.4 Unary type traits [meta.unary] Primary type categories [meta.unary.cat]

The primary type categories correspond to the descriptions given in section [basic.types] of the C++ standard.

For any given type T, the result of applying one of these templates to T and to cv T shall yield the same result.

[Note: For any given type T, exactly one of the primary type categories has a value member that evaluates to true. end note]

Table 40 — Primary type category predicates
template <class T>
struct is_­void;
T is void
template <class T>
struct is_­null_­pointer;
T is nullptr_­t ([basic.fundamental])
template <class T>
struct is_­integral;
T is an integral type
template <class T>
struct is_­floating_­point;
T is a floating-point type
template <class T>
struct is_­array;
T is an array type ([basic.compound]) of known or unknown extent Class template array is not an array type.
template <class T>
struct is_­pointer;
T is a pointer type Includes pointers to functions but not pointers to non-static members.
template <class T>
struct is_­lvalue_­reference;
T is an lvalue reference type
template <class T>
struct is_­rvalue_­reference;
T is an rvalue reference type
template <class T>
struct is_­member_­object_­pointer;
T is a pointer to non-static data member
template <class T>
struct is_­member_­function_­pointer;
T is a pointer to non-static member function
template <class T>
struct is_­enum;
T is an enumeration type ([basic.compound])
template <class T>
struct is_­union;
T is a union type ([basic.compound])
template <class T>
struct is_­class;
T is a non-union class type ([basic.compound])
template <class T>
struct is_­function;
T is a function type ([basic.compound])