4.3 KiB
4.3 KiB
[meta.unary.cat]
21 Metaprogramming library [meta]
21.3 Metaprogramming and type traits [type.traits]
21.3.6 Unary type traits [meta.unary]
21.3.6.2 Primary type categories [meta.unary.cat]
The primary type categories specified in Table 52 correspond to the descriptions given in subclause [basic.types] of the C++ standard.
For any given type T, the result of applying one of these templates toT and to cv T shall yield the same result.
[Note 1:
For any given type T, exactly one of the primary type categories has a value member that evaluates to true.
â end note]
Table 52 — Primary type category predicates [tab:meta.unary.cat]
| ð Template |
Condition | Comments |
|---|---|---|
| ð template struct is_void; |
T is void | |
| ð template struct is_null_pointer; |
T is nullptr_t ([basic.fundamental]) | |
| ð template struct is_integral; |
T is an integral type ([basic.fundamental]) | |
| ð template struct is_floating_point; |
T is a floating-point type ([basic.fundamental]) | |
| ð template struct is_array; |
T is an array type ([basic.compound]) of known or unknown extent | Class template array ([array]) is not an array type. |
| ð template struct is_pointer; |
T is a pointer type ([basic.compound]) | Includes pointers to functions but not pointers to non-static members. |
| ð template struct is_lvalue_reference; |
T is an lvalue reference type ([dcl.ref]) | |
| ð template struct is_rvalue_reference; |
T is an rvalue reference type ([dcl.ref]) | |
| ð template struct is_member_object_pointer; |
T is a pointer to data member | |
| ð template struct is_member_function_pointer; |
T is a pointer to member function | |
| ð template struct is_enum; |
T is an enumeration type ([basic.compound]) | |
| ð template struct is_union; |
T is a union type ([basic.compound]) | |
| ð template struct is_class; |
T is a non-union class type ([basic.compound]) | |
| ð template struct is_function; |
T is a function type ([basic.compound]) | |
| ð template struct is_reflection; |
T is std::meta::info ([basic.fundamental]) |