[meta.unary.cat]

# 21 Metaprogramming library [[meta]](./#meta)

## 21.3 Metaprogramming and type traits [[type.traits]](type.traits#meta.unary.cat)

### 21.3.6 Unary type traits [[meta.unary]](meta.unary#cat)

#### 21.3.6.2 Primary type categories [meta.unary.cat]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L926)

The primary type categories specified in Table [52](#tab:meta.unary.cat "Table 52: Primary type category predicates") correspond to the descriptions given in
subclause [[basic.types]](basic.types "6.9 Types") of the C++ standard[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L931)

For any given type T, the result of applying one of these templates toT and to cv T shall yield the same result[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L935)

[*Note [1](#note-1)*:

For any given type T, exactly one of the primary type categories
has a value member that evaluates to true[.](#3.sentence-1)

â *end note*]

Table [52](#tab:meta.unary.cat) — Primary type category predicates [[tab:meta.unary.cat]](./tab:meta.unary.cat)  

| [ð](#tab:meta.unary.cat-row-1)<br>**Template** | **Condition** | **Comments** |
| --- | --- | --- |
| [ð](#tab:meta.unary.cat-row-2)<br>template<class T>   struct [is_void](#lib:is_void "21.3.6.2 Primary type categories [meta.unary.cat]"); | T is void |  |
| [ð](#tab:meta.unary.cat-row-3)<br>template<class T>   struct [is_null_pointer](#lib:is_null_pointer "21.3.6.2 Primary type categories [meta.unary.cat]"); | T is nullptr_t ([[basic.fundamental]](basic.fundamental "6.9.2 Fundamental types")) |  |
| [ð](#tab:meta.unary.cat-row-4)<br>template<class T>   struct [is_integral](#lib:is_integral "21.3.6.2 Primary type categories [meta.unary.cat]"); | T is an integral type ([[basic.fundamental]](basic.fundamental "6.9.2 Fundamental types")) |  |
| [ð](#tab:meta.unary.cat-row-5)<br>template<class T>   struct is_floating_point; | T is a floating-point type ([[basic.fundamental]](basic.fundamental "6.9.2 Fundamental types")) |  |
| [ð](#tab:meta.unary.cat-row-6)<br>template<class T>   struct is_array; | T is an array type ([[basic.compound]](basic.compound "6.9.4 Compound types")) of known or unknown extent | Class template array ([[array]](array "23.3.3 Class template array")) is not an array type[.](#tab:meta.unary.cat-row-6-column-3-sentence-1) |
| [ð](#tab:meta.unary.cat-row-7)<br>template<class T>   struct is_pointer; | T is a pointer type ([[basic.compound]](basic.compound "6.9.4 Compound types")) | Includes pointers to functions but not pointers to non-static members[.](#tab:meta.unary.cat-row-7-column-3-sentence-1) |
| [ð](#tab:meta.unary.cat-row-8)<br>template<class T>   struct is_lvalue_reference; | T is an lvalue reference type ([[dcl.ref]](dcl.ref "9.3.4.3 References")) |  |
| [ð](#tab:meta.unary.cat-row-9)<br>template<class T>   struct is_rvalue_reference; | T is an rvalue reference type ([[dcl.ref]](dcl.ref "9.3.4.3 References")) |  |
| [ð](#tab:meta.unary.cat-row-10)<br>template<class T>   struct is_member_object_pointer; | T is a pointer to data member |  |
| [ð](#tab:meta.unary.cat-row-11)<br>template<class T>   struct is_member_function_pointer; | T is a pointer to member function |  |
| [ð](#tab:meta.unary.cat-row-12)<br>template<class T>   struct is_enum; | T is an enumeration type ([[basic.compound]](basic.compound "6.9.4 Compound types")) |  |
| [ð](#tab:meta.unary.cat-row-13)<br>template<class T>   struct is_union; | T is a union type ([[basic.compound]](basic.compound "6.9.4 Compound types")) |  |
| [ð](#tab:meta.unary.cat-row-14)<br>template<class T>   struct is_class; | T is a non-union class type ([[basic.compound]](basic.compound "6.9.4 Compound types")) |  |
| [ð](#tab:meta.unary.cat-row-15)<br>template<class T>   struct is_function; | T is a function type ([[basic.compound]](basic.compound "6.9.4 Compound types")) |  |
| [ð](#tab:meta.unary.cat-row-16)<br>template<class T>   struct is_reflection; | T is std​::​meta​::​info ([[basic.fundamental]](basic.fundamental "6.9.2 Fundamental types")) |  |
