Files
2025-10-25 03:02:53 +03:00

4.3 KiB
Raw Permalink Blame History

[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]

1

#

The primary type categories specified in Table 52 correspond to the descriptions given in subclause [basic.types] of the C++ standard.

2

#

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

3

#

[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])