fennec
Loading...
Searching...
No Matches
Type Traits

Part of the fennec metaprogramming library. This header defines structures for accessing traits of types at compile time.

Type Categories

Syntax Description

is_void<TypeT>::value
is_void_v<TypeT>

Stores a boolean value in is_void::value, representing whether the provided type is of base type void.

Template Parameters
Ttype to check

is_null_pointer<TypeT>::value
is_null_pointer_v<TypeT>

Stores a boolean value in is_null_pointer::value, representing whether the provided type is of base type nullptr_t.

Template Parameters
Ttype to check

is_bool<TypeT>::value
is_bool_v<TypeT>

Stores a boolean value in is_bool::value, representing whether the provided type is of base type bool.

Template Parameters
Ttype to check

is_integral<TypeT>::value
is_integral_v<TypeT>

Stores a boolean value in is_integral::value, representing whether the provided type is of a base integer type.

Template Parameters
Ttype to check

is_floating_point<TypeT>::value
is_floating_point_v<TypeT>

Stores a boolean value in is_floating_point::value, representing whether the provided type is of a base floating point type.

Template Parameters
Ttype to check

is_array<TypeT>::value
is_array_v<TypeT>

Template Parameters
Ttype to check

is_enum<TypeT>::value
is_enum_v<TypeT>

Template Parameters
Ttype to check

is_union<TypeT>::value
is_union_v<TypeT>

Template Parameters
Ttype to check

is_class<TypeT>::value
is_class_v<TypeT>

Template Parameters
Ttype to check

is_function<TypeT>::value
is_function_v<TypeT>

Template Parameters
Ttype to check

is_pointer<TypeT>::value
is_pointer_v<TypeT>

Stores a boolean value in is_pointer::value, representing whether the provided type is of a base pointer type.

Template Parameters
Ttype to check

is_lvalue_reference<TypeT>::value
is_lvalue_reference_v<TypeT>

Checks if type T is a floating point type and store it in is_same::value.

Template Parameters
Ttype to check

is_rvalue_reference<TypeT>::value
is_rvalue_reference_v<TypeT>

Checks if type T is a floating point type and store it in is_same::value.

Template Parameters
Ttype to check

is_member_object_pointer<TypeT>::value
is_member_object_pointer_v<TypeT>

Checks if type T is pointer to a member object and store it in is_member_object_pointer::value.

Template Parameters
Ttype to check

is_member_function_pointer<TypeT>::value
is_member_function_pointer_v<TypeT>

Checks if type T is pointer to a member function and store it in is_member_function_pointer::value.

Template Parameters
Ttype to check

Type Categories

Syntax

Description


is_arithmetic<TypeT>::value
is_arithmetic_v<TypeT>

Checks if type T is a built-in type with arithmetic operators and store it in is_same::value.

Template Parameters
Ttype to check

is_fundamental<TypeT>::value
is_fundamental_v<TypeT>

Template Parameters
Ttype to check

is_scalar<TypeT>::value
is_scalar_v<TypeT>

Checks if type T is a built-in type with arithmetic operators and store it in is_same::value.

Template Parameters
Ttype to check

is_object<TypeT>::value
is_object_v<TypeT>

Checks if type T is an object and store it in is_same::value.

Template Parameters
Ttype to check

is_compound<TypeT>::value
is_compound_v<TypeT>

Checks if type T is an object and store it in is_same::value.

Template Parameters
Ttype to check

is_reference<TypeT>::value
is_reference_v<TypeT>

Checks if type T is a floating point type and store it in is_same::value.

Template Parameters
Ttype to check

is_member_pointer<TypeT>::value
is_member_pointer_v<TypeT>

Checks if type T is pointer to a member and store it in is_member_function_pointer::value.

Template Parameters
Ttype to check

Properties

Syntax

Description


is_const<TypeT>::value
is_const_v<TypeT>


is_volatile<TypeT>::value
is_volatile_v<TypeT>


is_trivial<TypeT>::value
is_trivial_v<TypeT>

Checks if T

Template Parameters
Ttype to check

is_trivially_copyable<TypeT>::value
is_trivially_copyable_v<TypeT>

Checks if T

Template Parameters
Ttype to check

is_standard_layout<TypeT>::value
is_standard_layout_v<TypeT>

Checks if T

Template Parameters
Ttype to check

has_unique_object_representations<TypeT>::value
has_unique_object_representations_v<TypeT>

Checks if T

Template Parameters
Ttype to check

is_empty<TypeT>::value
is_empty_v<TypeT>

Checks if T

Template Parameters
Ttype to check

is_polymorphic<TypeT>::value
is_polymorphic_v<TypeT>

Checks if T

Template Parameters
Ttype to check

is_abstract<TypeT>::value
is_abstract_v<TypeT>

Checks if T

Template Parameters
Ttype to check

is_complete<TypeT>::value
is_complete_v<TypeT>

Checks if T

Template Parameters
Ttype to check

is_final<TypeT>::value
is_final_v<TypeT>

Checks if T

Template Parameters
Ttype to check

is_aggregate<TypeT>::value
is_aggregate_v<TypeT>

Checks if T

Template Parameters
Ttype to check

is_signed<TypeT>::value
is_signed_v<TypeT>

Checks if type T is a signed type i.e. T(-1) < T(0) and stores it in is_same::value.

Template Parameters
Ttype to check

is_unsigned<TypeT>::value
is_unsigned_v<TypeT>

Checks if type T is an unsigned type i.e. T(-1) > T(0) and stores it in is_same::value.

Template Parameters
Ttype to check

is_bounded_array<TypeT>::value
is_bounded_array_v<TypeT>


is_unbounded_array<TypeT>::value
is_unbounded_array_v<TypeT>


is_scoped_enum<TypeT>::value
is_scoped_enum_v<TypeT>

Operations

Syntax

Description


is_convertible<TypeT0, TypeT1>::value
is_convertible_v<TypeT>

Checks if TypeT0

Template Parameters
FromTFirst type
ToTSecond type

is_constructible<ClassT, ArgsT...>::value
is_constructible_v<ClassT, ArgsT...> is_trivially_constructible<ClassT, ArgsT...>::value
is_trivially_constructible_v<ClassT, ArgsT...> is_nothrow_constructible<ClassT, ArgsT...>::value
is_nothrow_constructible_v<ClassT, ArgsT...>

Template Parameters
ClassTThe class type to test
ArgsTThe arguments for the specific constructor

is_default_constructible<ClassT, ArgsT...>::value
is_default_constructible_v<ClassT, ArgsT...> is_trivially_default_constructible<ClassT, ArgsT...>::value
is_trivially_default_constructible_v<ClassT, ArgsT...> is_nothrow_default_constructible<ClassT, ArgsT...>::value
is_nothrow_default_constructible_v<ClassT, ArgsT...>

Template Parameters
ClassTThe class type to test

is_copy_constructible<ClassT, ArgsT...>::value
is_copy_constructible_v<ClassT, ArgsT...> is_trivially_copy_constructible<ClassT, ArgsT...>::value
is_trivially_copy_constructible_v<ClassT, ArgsT...> is_nothrow_copy_constructible<ClassT, ArgsT...>::value
is_nothrow_copy_constructible_v<ClassT, ArgsT...>

Template Parameters
ClassTThe class type to test

is_move_constructible<ClassT, ArgsT...>::value
is_move_constructible_v<ClassT, ArgsT...> is_trivially_move_constructible<ClassT, ArgsT...>::value
is_trivially_move_constructible_v<ClassT, ArgsT...> is_nothrow_move_constructible<ClassT, ArgsT...>::value
is_nothrow_move_constructible_v<ClassT, ArgsT...>

Template Parameters
ClassTThe class type to test

is_assignable<ClassT, ArgsT...>::value
is_assignable_v<ClassT, ArgsT...> is_trivially_assignable<ClassT, ArgsT...>::value
is_trivially_assignable_v<ClassT, ArgsT...> is_nothrow_assignable<ClassT, ArgsT...>::value
is_nothrow_assignable_v<ClassT, ArgsT...>

Template Parameters
ClassATThe class type to test
ClassBTThe arguments for the specific constructor

is_copy_assignable<ClassT, ArgsT...>::value
is_copy_assignable_v<ClassT, ArgsT...> is_trivially_copy_assignable<ClassT, ArgsT...>::value
is_trivially_copy_assignable_v<ClassT, ArgsT...> is_nothrow_copy_assignable<ClassT, ArgsT...>::value
is_nothrow_copy_assignable_v<ClassT, ArgsT...>

Template Parameters
ClassTThe class type to test

is_move_assignable<ClassT, ArgsT...>::value
is_move_assignable_v<ClassT, ArgsT...> is_trivially_move_assignable<ClassT, ArgsT...>::value
is_trivially_move_assignable_v<ClassT, ArgsT...> is_nothrow_move_assignable<ClassT, ArgsT...>::value
is_nothrow_move_assignable_v<ClassT, ArgsT...>

Template Parameters
ClassTThe class type to test

is_destructible<ClassT, ArgsT...>::value
is_destructible_v<ClassT, ArgsT...> is_trivially_destructible<ClassT, ArgsT...>::value
is_trivially_destructible_v<ClassT, ArgsT...> is_nothrow_destructible<ClassT, ArgsT...>::value
is_nothrow_destructible_v<ClassT, ArgsT...>

Template Parameters
ClassTThe class type to test

has_virtual_destructor<ClassT, ArgsT...>::value
has_virtual_destructor_v<ClassT, ArgsT...>

Properties

Syntax

Description


is_same<TypeT>::value
is_same_v<TypeT>

Checks if T0 and T1 are identical and store it in is_same::value

Template Parameters
T0first type to check
T1second type to check