module
Metafunctions and type traitsType traits and metaprogramming utilities.
Classes
-
template <typename... T>struct muu::type_list
- A 'tag' type for encoding/parameterizing lists of types (without the instantiation heft of std::
tuple).
Typedefs
-
template <typename T>using add_const = typename impl::rebase_ref_<T, std::
add_const_t<std:: remove_reference_t<T>>>::type - Adds a const qualifier to a type or reference.
-
template <typename T>using add_cv = typename impl::rebase_ref_<T, std::
add_volatile_t<std:: add_const_t<std:: remove_reference_t<T>>>>::type - Adds const and volatile qualifiers to a type or reference.
-
template <typename T>using add_noexcept = copy_cvref<typename impl::add_noexcept_<remove_cvref<T>>::type, T>
- Adds a
noexcept
specifier to a functional type (or reference to one). -
template <typename T>using add_volatile = typename impl::rebase_ref_<T, std::
add_volatile_t<std:: remove_reference_t<T>>>::type - Adds a volatile qualifier to a type or reference.
-
template <typename T>using clamp_to_standard_float = demote_if_large_float<promote_if_small_float<T>>
- Clamps extended arithmetic floating-point types (e.g. __fp16, __float128) to
float
orlong double
. -
template <typename T, bool AddConst>using conditionally_add_const = std::
conditional_t<AddConst, add_const<T>, T> - Shorthand for conditionally adding const to a type or reference.
-
template <typename T, bool AddConstVolatile>using conditionally_add_cv = std::
conditional_t<AddConstVolatile, add_cv<T>, T> - Shorthand for conditionally adding const and volatile qualifiers to a type or reference.
-
template <typename T, bool AddVolatile>using conditionally_add_volatile = std::
conditional_t<AddVolatile, add_volatile<T>, T> - Shorthand for conditionally adding volatile to a type or reference.
-
template <typename T, typename CopyFrom>using copy_const = set_const<T, is_const<CopyFrom>>
- Copies the constness (or lack thereof) from one type or reference to another.
-
template <typename T, typename CopyFrom>using copy_cv = copy_const<copy_volatile<T, CopyFrom>, CopyFrom>
- Copies consteness and volatility (or lack thereof) from one type or reference to another.
-
template <typename T, typename CopyFrom>using copy_cvref = copy_ref<copy_cv<std::
remove_reference_t<T>, std:: remove_reference_t<CopyFrom>>, CopyFrom> - Copies consteness, volatility and reference category (or lack thereof) from one type or to another.
-
template <typename T, typename CopyFrom>using copy_ref = typename impl::copy_ref_<T, CopyFrom>::type
- Copies the reference category (or lack thereof) from one type or to another.
-
template <typename T, typename CopyFrom>using copy_signed = set_signed<T, is_signed<CopyFrom>>
- Copies the signed-ness (or lack thereof) from one numeric type or reference to another.
-
template <typename T, typename CopyFrom>using copy_unsigned = set_unsigned<T, is_unsigned<CopyFrom>>
- Copies the unsigned-ness (or lack thereof) from one numeric type or reference to another.
-
template <typename T, typename CopyFrom>using copy_volatile = set_volatile<T, is_volatile<CopyFrom>>
- Copies the volatility (or lack thereof) from one type or reference to another.
-
template <typename T>using demote_if_large_float = std::
conditional_t<impl::is_large_float_<T>, typename impl::rebase_ref_<T, copy_cv<long double, T>>::type, T> - Demotes 'large' extended arithmetic floating-point types (e.g. __float128) to
long double
. -
template <typename... T>using epsilon_type = impl::std_math_common_type<remove_cvref<T>...>
- A common epsilon type when comparing floating-point types named by T.
-
template <size_t N>using index_tag = std::
integral_constant<size_t, N> - A tag type for encoding/parameterizing a single index.
-
template <typename T, typename... U>using largest = typename impl::largest_<T, U...>::type
- The largest type from a set of types.
-
template <typename T, typename... U>using least_aligned = typename impl::least_aligned_<T, U...>::type
- The type with the smallest alignment (i.e. having the smallest value for
alignment_of<T>
) from a set of types. -
template <typename T>using make_cref = std::
add_lvalue_reference_t<std:: add_const_t<remove_cvref<T>>> - Makes a type into a const lvalue reference (replacing existing cvref qualifiers).
-
template <typename T>using make_signed = typename impl::make_signed_<T>::type
- Converts a numeric type to the signed equivalent with the same rank.
-
template <typename T>using make_unsigned = typename impl::make_unsigned_<T>::type
- Converts a numeric type to the unsigned equivalent with the same rank.
-
template <typename T, typename... U>using most_aligned = typename impl::most_aligned_<T, U...>::type
- The type with the largest alignment (i.e. having the largest value for
alignment_of<T>
) from a set of types. -
template <typename T>using promote_if_small_float = std::
conditional_t<impl::is_small_float_<T>, typename impl::rebase_ref_<T, copy_cv<float, T>>::type, T> - Promotes 'small' extended arithmetic floating-point types (e.g. __fp16, etc.) to
float
. -
template <typename T>using readonly_param = typename impl::readonly_param_<std::
remove_reference_t<T>>::type - Resolves to
T
orconst T&
based on the performance characteristics ofT
being passed by value into a function. -
template <typename Ptr, typename NewBase>using rebase_pointer = typename impl::rebase_pointer_<Ptr, NewBase>::type
- Rebases a pointer, preserving the const and volatile qualification of the pointed type.
-
template <typename T>using remove_all_pointers = typename impl::remove_all_pointers_<T>::type
- Strips every level of pointer from a type.
-
template <typename T>using remove_callconv = copy_cvref<typename impl::remove_callconv_<remove_cvref<T>>::type, T>
- Removes any explicit calling convention specifiers from functions, function pointers and function references.
-
template <typename T>using remove_const = typename impl::rebase_ref_<T, std::
remove_const_t<std:: remove_reference_t<T>>>::type - Removes the topmost const qualifier from a type or reference.
-
template <typename T>using remove_cv = typename impl::rebase_ref_<T, std::
remove_volatile_t<std:: remove_const_t<std:: remove_reference_t<T>>>>::type - Removes the topmost const and volatile qualifiers from a type or reference.
-
template <typename T>using remove_cvref = std::
remove_cv_t<std:: remove_reference_t<T>> - Removes the topmost const, volatile and reference qualifiers from a type.
-
template <typename T>using remove_enum = typename impl::remove_enum_<T>::type
- Removes the outer enum wrapper from a type, converting it to the underlying integer equivalent.
-
template <typename T>using remove_lvalue_reference = typename impl::remove_lvalue_reference_<T>::type
- Removes reference qualification from a type if (and only if) it is an lvalue reference.
-
template <typename T>using remove_noexcept = copy_cvref<typename impl::remove_noexcept_<remove_cvref<T>>::type, T>
- Removes any
noexcept
specifier from a functional type (or reference to one). -
template <typename T>using remove_rvalue_reference = typename impl::remove_rvalue_reference_<T>::type
- Removes reference qualification from a type if (and only if) it is an rvalue reference.
-
template <typename T>using remove_volatile = typename impl::rebase_ref_<T, std::
remove_volatile_t<std:: remove_reference_t<T>>>::type - Removes the topmost volatile qualifier from a type or reference.
-
template <typename T, bool Const>using set_const = std::
conditional_t<Const, add_const<T>, remove_const<T>> - Sets the constness of a type or reference according to a boolean.
-
template <typename T, bool ConstVolatile>using set_cv = std::
conditional_t<ConstVolatile, add_cv<T>, remove_cv<T>> - Sets the constness and volatility of a type or reference according to a boolean.
-
template <typename T, bool Signed>using set_signed = std::
conditional_t<Signed, make_signed<T>, make_unsigned<T>> - Sets the signed-ness of a numeric type or reference according to a boolean.
-
template <typename T, bool Unsigned>using set_unsigned = std::
conditional_t<Unsigned, make_unsigned<T>, make_signed<T>> - Sets the unsigned-ness of a numeric type or reference according to a boolean.
-
template <typename T, bool Volatile>using set_volatile = std::
conditional_t<Volatile, add_volatile<T>, remove_volatile<T>> - Sets the volatility of a type or reference according to a boolean.
-
template <size_t Bits>using signed_integer = typename decltype(impl::sint_for_bits_impl<Bits>())::type
- Gets the signed integer type with a specific number of bits for the target platform.
-
template <typename T, typename... U>using smallest = typename impl::smallest_<T, U...>::type
- The smallest type from a set of types.
-
template <auto I, typename... T>using type_at_index =
/* ... */
- The type at the given index in the list.
-
template <typename T>using type_identity = typename impl::type_identity_<T>::type
- Provides an identity type transformation.
-
template <typename T>using type_tag = type_list<T>
- A tag type for encoding/parameterizing a single type.
-
template <size_t Bits>using unsigned_integer = typename decltype(impl::uint_for_bits_impl<Bits>())::type
- Gets the unsigned integer type with a specific number of bits for the target platform.
-
template <typename T>using vector_param = typename impl::vector_param_<std::
remove_reference_t<T>>::type - Same as readonly_
param, but also takes SIMD vector types and MSVC's __vectorcall
into account. - using w_axis_tag = index_tag<3>
- An index_tag specialization for representing the W axis.
- using x_axis_tag = index_tag<0>
- An index_tag specialization for representing the X axis.
- using y_axis_tag = index_tag<1>
- An index_tag specialization for representing the Y axis.
- using z_axis_tag = index_tag<2>
- An index_tag specialization for representing the Z axis.
Variables
-
template <typename T>size_t alignment_of constexpr
- The default alignment of a type.
-
template <typename... T>bool all_arithmetic constexpr
- Are all of the named types arithmetic or reference-to-arithmetic?
-
template <typename... T>bool all_array constexpr
- Are all of the named types arrays, or references to arrays?
-
template <typename... T>bool all_bounded_array constexpr
- Are all of the named types a bounded array (
T[N]
), or a reference to one? -
template <typename... T>bool all_const constexpr
- Are all of the named types const or reference-to-const?
-
template <typename To, typename... From>bool all_convertible_to constexpr
- True if all of the types named by
From
are implicitly or explicitly convertible toTo
. -
template <typename... T>bool all_cv constexpr
- Are all of the named types const and/or volatile-qualified, or references to const and/or volatile-qualified?
-
template <typename... T>bool all_cvref constexpr
- Are all of the named types const, volatile, or a reference?
-
template <typename... T>bool all_enum constexpr
- Are all of the named types enums or reference-to-enum?
-
template <typename To, typename... From>bool all_explicitly_convertible_to constexpr
- True if all of the types named by
From
are explicitly convertible toTo
. -
template <typename To, typename... From>bool all_explicitly_nothrow_convertible_to constexpr
- True if all of the types named by
From
are explicitly nothrow-convertible toTo
. -
template <typename... T>bool all_floating_point constexpr
- Are all of the named types floating-point or reference-to-floating-point?
-
template <typename... T>bool all_function constexpr
- Are all of the named types free/static functions, or references to them?
-
template <typename... T>bool all_function_pointer constexpr
- Are all of the named types free/static function pointers, or references to them?
-
template <typename To, typename... From>bool all_implicitly_convertible_to constexpr
- True if all of the types named by
From
are implicitly convertible toTo
. -
template <typename To, typename... From>bool all_implicitly_nothrow_convertible_to constexpr
- True if all of the types named by
From
are implicitly nothrow-convertible toTo
. -
template <typename... T>bool all_integer constexpr
- Are all of the named types arithmetic integers, or reference to them?
-
template <typename... T>bool all_integral constexpr
- Are all of the named types integral or reference-to-integral?
-
template <typename... T>bool all_legacy_enum constexpr
- Are all of the named types pre-C++11 unscoped enums, or references to one?
-
template <typename To, typename... From>bool all_nothrow_convertible_to constexpr
- True if all of the types named by
From
are implicitly or explicitly nothrow-convertible toTo
. -
template <typename T, typename... U>bool all_same constexpr
- True if all the named types are exactly the same.
-
template <typename... T>bool all_scoped_enum constexpr
- Are all of the named types C++11 scoped enum classes, or references to one?
-
template <typename... T>bool all_signed constexpr
- Are all of the named types signed or reference-to-signed?
-
template <typename... T>bool all_unbounded_array constexpr
- Are all of the named types an unbounded array (
T[]
), or a reference to one? -
template <typename... T>bool all_unsigned constexpr
- Are all of the named types unsigned or reference-to-unsigned?
-
template <typename... T>bool all_volatile constexpr
- Are all of the named types volatile or reference-to-volatile?
-
template <typename From, typename To>bool allow_implicit_bit_cast constexpr
- Allows the library to implicitly convert via bit casting in some situations.
-
template <typename... T>bool always_false constexpr
- Evaluates to false but with delayed, type-dependent evaluation.
-
template <typename... T>bool any_arithmetic constexpr
- Are any of the named types arithmetic or reference-to-arithmetic?
-
template <typename... T>bool any_array constexpr
- Are any of the named types arrays, or references to arrays?
-
template <typename... T>bool any_bounded_array constexpr
- Are any of the named types a bounded array (
T[N]
), or a reference to one? -
template <typename... T>bool any_const constexpr
- Are any of the named types const or reference-to-const?
-
template <typename... T>bool any_cv constexpr
- Are any of the named types const and/or volatile-qualified, or references to const and/or volatile-qualified?
-
template <typename... T>bool any_cvref constexpr
- Are any of the named types const, volatile, or a reference?
-
template <typename... T>bool any_enum constexpr
- Are any of the named types enums or reference-to-enum?
-
template <typename... T>bool any_floating_point constexpr
- Are any of the named types floating-point or reference-to-floating-point?
-
template <typename... T>bool any_function constexpr
- Are any of the named types free/static functions, or references to them?
-
template <typename... T>bool any_function_pointer constexpr
- Are any of the named types free/static function pointers, or references to them?
-
template <typename... T>bool any_integer constexpr
- Are any of the named types arithmetic integers, or reference to them?
-
template <typename... T>bool any_integral constexpr
- Are any of the named types integral or reference-to-integral?
-
template <typename... T>bool any_legacy_enum constexpr
- Are any of the named types pre-C++11 unscoped enums, or references to one?
-
template <typename T, typename... U>bool any_same constexpr
- True if T is exactly the same as one or more of the types named by U.
-
template <typename... T>bool any_scoped_enum constexpr
- Are any of the named types C++11 scoped enum classes, or references to one?
-
template <typename... T>bool any_signed constexpr
- Are any of the named types signed or reference-to-signed?
-
template <typename... T>bool any_unbounded_array constexpr
- Are any of the named types an unbounded array (
T[]
), or a reference to one? -
template <typename... T>bool any_unsigned constexpr
- Are any of the named types unsigned or reference-to-unsigned?
-
template <typename... T>bool any_volatile constexpr
- Are any of the named types volatile or reference-to-volatile?
-
template <typename T>size_t arity constexpr
- Returns the arity (parameter count) of a function, function pointer, stateless lambda, or class/union type with an unambiguous
operator()
overload. -
template <typename T>bool decays_to_function_pointer_by_unary_plus constexpr
- Evaluates to true if an instance of
T
decays to a free-function pointer by explicit unary plus. -
template <typename T>bool decays_to_pointer_by_unary_plus constexpr
- Evaluates to true if an instance of
T
decays to a pointer by explicit unary plus. -
template <typename... T>epsilon_type<T...> default_epsilon constexpr
- The default floating-point epsilon value used when comparing floating-point types named by T.
-
template <typename T, typename U = T>bool has_addition_operator constexpr
- True if a pair of types has an addition operator (
T + U
). -
template <typename T>bool has_arrow_operator constexpr
- True if a type has an arrow operator (
T->
). -
template <typename T, typename U = T>bool has_bitwise_and_operator constexpr
- True if a pair of types has a bitwise AND operator (
T & U
). -
template <typename T, typename U = T>bool has_bitwise_lsh_operator constexpr
- True if a pair of types has a bitwise left-shift operator (
T << U
). -
template <typename T>bool has_bitwise_not_operator constexpr
- True if a type has a unary bitwise NOT operator (
~T
). -
template <typename T, typename U = T>bool has_bitwise_or_operator constexpr
- True if a pair of types has a bitwise OR operator (
T | U
). -
template <typename T, typename U = T>bool has_bitwise_rsh_operator constexpr
- True if a pair of types has a bitwise right-shift operator (
T >> U
). -
template <typename T, typename U = T>bool has_bitwise_xor_operator constexpr
- True if a pair of types has a bitwise XOR operator (
T ^ U
). -
template <typename T>bool has_data_member_function constexpr
- True if a type has a member function
data()
returning a pointer. -
template <typename T, typename U = T>bool has_division_operator constexpr
- True if a pair of types has a division operator (
T / U
). -
template <typename T, typename U = T>bool has_equality_operator constexpr
- True if a pair of types has an equality operator (
T == U
). -
template <typename T, typename U = T>bool has_greater_than_operator constexpr
- True if a pair of types has a greater-than operator (
T > U
). -
template <typename T, typename U = T>bool has_greater_than_or_equal_operator constexpr
- True if a pair of types has a greater-than-or-equal operator (
T >= U
). -
template <typename T>bool has_indirection_operator constexpr
- True if a type has an indirection operator (
*T
). -
template <typename T, typename U = T>bool has_inequality_operator constexpr
- True if a pair of types has an inequality operator (
T != U
). -
template <typename T, typename U = T>bool has_less_than_operator constexpr
- True if a pair of types has a less-than operator (
T < U
). -
template <typename T, typename U = T>bool has_less_than_or_equal_operator constexpr
- True if a pair of types has a less-than-or-equal operator (
T <= U
). -
template <typename T, typename U = T>bool has_logical_and_operator constexpr
- True if a pair of types has a logical AND operator (
T && U
). -
template <typename T>bool has_logical_not_operator constexpr
- True if a type has a unary logical NOT operator (
!T
). -
template <typename T, typename U = T>bool has_logical_or_operator constexpr
- True if a pair of types has a logical OR operator (
T || U
). -
template <typename T, typename U = T>bool has_modulo_operator constexpr
- True if a pair of types has an modulo operator (
T % U
). -
template <typename T, typename U = T>bool has_multiplication_operator constexpr
- True if a pair of types has a multiplication operator (
T * U
). -
template <typename T>bool has_post_decrement_operator constexpr
- True if a type has a post-decrement operator (
T--
). -
template <typename T>bool has_post_increment_operator constexpr
- True if a type has a post-increment operator (
T++
). -
template <typename T>bool has_pre_decrement_operator constexpr
- True if a type has a pre-decrement operator (
--T
). -
template <typename T>bool has_pre_increment_operator constexpr
- True if a type has a pre-increment operator (
++T
). -
template <typename T>bool has_size_member_function constexpr
- True if a type has a member function
size()
returning an arithmetic integral type. -
template <typename T, typename U = size_t>bool has_subscript_operator constexpr
- True if a pair of types has a subscript operator (
T[U]
). -
template <typename T, typename U = T>bool has_subtraction_operator constexpr
- True if a pair of types has a subtraction operator (
T - U
). -
template <typename T>bool has_unambiguous_function_call_operator constexpr
- True if a type has single non-template operator() overload.
-
template <typename T>bool has_unary_minus_operator constexpr
- True if a type has a unary minus operator (
-T
). -
template <typename T>bool has_unary_plus_operator constexpr
- True if a type has a unary plus operator (
+T
). -
template <typename T, typename U, typename... V>size_t index_of_type constexpr
- The index of the first appearance of the type T in the type list [U, V...].
-
template <typename Child, typename Parent>bool inherits_from constexpr
- Does Child inherit from Parent?
-
template <typename Child, typename Parent, typename... Parents>bool inherits_from_all constexpr
- Does Child inherit from all of the types named by Parent?
-
template <typename Child, typename Parent, typename... Parents>bool inherits_from_any constexpr
- Does Child inherit from any of the types named by Parent?
-
template <typename T>bool is_arithmetic constexpr
- Is a type arithmetic or reference-to-arithmetic?
-
template <typename T>bool is_array constexpr
- Is a type an array, or reference to one?
-
template <typename T>bool is_bounded_array constexpr
- Is a type a bounded array (
T[N]
), or reference to one? -
template <typename T>bool is_character constexpr
- Is a type a built-in text character (code unit) type, or reference to one?
-
template <typename T>bool is_code_unit constexpr
- Is a type a built-in text code unit (character) type, or reference to one?
-
template <typename T>bool is_const constexpr
- Is a type const or reference-to-const?
-
template <typename From, typename To>bool is_convertible constexpr
- True if
From
is implicitly or explicitly convertible toTo
. -
template <typename From, typename... To>bool is_convertible_to_all constexpr
- True if
From
is implicitly or explicitly convertible to all of the types named byTo
. -
template <typename From, typename... To>bool is_convertible_to_any constexpr
- True if
From
is implicitly or explicitly convertible to any of the types named byTo
. -
template <typename T>bool is_cv constexpr
- Is a type const and/or volatile-qualified?
-
template <typename T>bool is_cvref constexpr
- Is a type const, volatile, or a reference?
-
template <template<typename...> typename Trait, typename... Args>auto is_detected constexpr
- Detects if a type supports an interface.
-
template <typename T>bool is_enum constexpr
- Is a type an enum or reference-to-enum?
-
template <typename From, typename To>bool is_explicitly_convertible constexpr
- True if
From
is explicitly convertible toTo
. -
template <typename From, typename... To>bool is_explicitly_convertible_to_all constexpr
- True if
From
is explicitly convertible to all of the types named byTo
. -
template <typename From, typename... To>bool is_explicitly_convertible_to_any constexpr
- True if
From
is explicitly convertible to any of the types named byTo
. -
template <typename From, typename To>bool is_explicitly_nothrow_convertible constexpr
- True if
From
is explicitly nothrow-convertible toTo
. -
template <typename From, typename... To>bool is_explicitly_nothrow_convertible_to_all constexpr
- True if
From
is explicitly nothrow-convertible to all of the types named byTo
. -
template <typename From, typename... To>bool is_explicitly_nothrow_convertible_to_any constexpr
- True if
From
is explicitly nothrow-convertible to any of the types named byTo
. -
template <typename T>bool is_extended_arithmetic constexpr
- Is a type a nonstandard 'extended' arithmetic type, or a reference to one?
-
template <typename T>bool is_floating_point constexpr
- Is a type a floating-point or reference-to-floating-point?
-
template <typename T>bool is_function constexpr
- Is a type a free/static function, or reference to one?
-
template <typename T>bool is_function_pointer constexpr
- Is a type a free/static function pointer, or reference to one?
-
template <typename From, typename To>bool is_implicitly_convertible constexpr
- True if
From
is implicitly convertible toTo
. -
template <typename From, typename... To>bool is_implicitly_convertible_to_all constexpr
- True if
From
is implicitly convertible to all of the types named byTo
. -
template <typename From, typename... To>bool is_implicitly_convertible_to_any constexpr
- True if
From
is implicitly convertible to any of the types named byTo
. -
template <typename From, typename To>bool is_implicitly_nothrow_convertible constexpr
- True if
From
is implicitly nothrow-convertible toTo
. -
template <typename From, typename... To>bool is_implicitly_nothrow_convertible_to_all constexpr
- True if
From
is implicitly nothrow-convertible to all of the types named byTo
. -
template <typename From, typename... To>bool is_implicitly_nothrow_convertible_to_any constexpr
- True if
From
is implicitly nothrow-convertible to any of the types named byTo
. -
template <typename T>bool is_integer constexpr
- Is a type an arithmetic integer type, or reference to one?
-
template <typename T>bool is_integral constexpr
- Is a type an integral type or a reference to an integral type?
-
template <typename T>bool is_iterable constexpr
- Returns true if a type is a bounded array or a class type having
begin()
andend()
iterators (as members, in thestd
namespace, or found via ADL). -
template <typename T>bool is_legacy_enum constexpr
- Is a type a pre-C++11 unscoped enum, or reference to one?
-
template <typename T>bool is_mutex_like constexpr
- True if a type has a lock interface compatible with std::
mutex. -
template <typename From, typename To>bool is_nothrow_convertible constexpr
- True if
From
is implicitly or explicitly nothrow-convertible toTo
. -
template <typename From, typename... To>bool is_nothrow_convertible_to_all constexpr
- True if
From
is implicitly or explicitly nothrow-convertible to all of the types named byTo
. -
template <typename From, typename... To>bool is_nothrow_convertible_to_any constexpr
- True if
From
is implicitly or explicitly nothrow-convertible to any of the types named byTo
. -
template <typename T>bool is_scoped_enum constexpr
- Is a type a C++11 scoped enum class, or reference to one?
-
template <typename T>bool is_shared_mutex_like constexpr
- True if a type has a lock interface compatible with std::
shared_mutex. -
template <typename T>bool is_signed constexpr
- Is a type signed or reference-to-signed?
-
template <typename T>bool is_standard_arithmetic constexpr
- Is a type one of the standard c++ arithmetic types, or a reference to one?
-
template <typename T, typename CompatibleWithFunc = void>bool is_stateless_lambda constexpr
- Evaluates to true if
T
is a stateless lambda type, or a reference to one. -
template <typename T>bool is_trivially_manifestable constexpr
- Evaluates to true if
T
is an empty class/union with trivial default constructor and destructor, or a reference to one. -
template <typename T>bool is_tuple_like constexpr
- True if the type implements std::tuple_size and std::tuple_element.
-
template <typename T>bool is_unbounded_array constexpr
- Is a type an unbounded array (
T[]
), or reference to one? -
template <typename T>bool is_unsigned constexpr
- Is a type unsigned or reference-to-unsigned?
-
template <typename T>bool is_volatile constexpr
- Is a type volatile or reference-to-volatile?
-
template <typename T>size_t pointer_rank constexpr
- The rank of a pointer.
-
template <typename... T>size_t total_size constexpr
- The sum of
sizeof()
for all of the types named by T. -
template <typename T>size_t tuple_size constexpr
- Equivalent to std::tuple_size_v, but safe to use in SFINAE contexts.
-
template <typename T>auto type_name constexpr
- A muu::
fixed_string containing the name of a type. -
template <typename... T>auto type_name_list constexpr
- A muu::
fixed_string containing a comma-delimited list of type names.
Typedef documentation
#include <muu/meta.h>
template <typename T>
using add_const = typename impl::rebase_ref_<T, std:: add_const_t<std:: remove_reference_t<T>>>::type
Adds a const qualifier to a type or reference.
#include <muu/meta.h>
template <typename T>
using add_cv = typename impl::rebase_ref_<T, std:: add_volatile_t<std:: add_const_t<std:: remove_reference_t<T>>>>::type
Adds const and volatile qualifiers to a type or reference.
#include <muu/meta.h>
template <typename T>
using add_noexcept = copy_cvref<typename impl::add_noexcept_<remove_cvref<T>>::type, T>
Adds a noexcept
specifier to a functional type (or reference to one).
#include <muu/meta.h>
template <typename T>
using add_volatile = typename impl::rebase_ref_<T, std:: add_volatile_t<std:: remove_reference_t<T>>>::type
Adds a volatile qualifier to a type or reference.
#include <muu/meta.h>
template <typename T>
using clamp_to_standard_float = demote_if_large_float<promote_if_small_float<T>>
Clamps extended arithmetic floating-point types (e.g. __fp16, __float128) to float
or long double
.
#include <muu/meta.h>
template <typename T, bool AddConst>
using conditionally_add_const = std:: conditional_t<AddConst, add_const<T>, T>
Shorthand for conditionally adding const to a type or reference.
#include <muu/meta.h>
template <typename T, bool AddConstVolatile>
using conditionally_add_cv = std:: conditional_t<AddConstVolatile, add_cv<T>, T>
Shorthand for conditionally adding const and volatile qualifiers to a type or reference.
#include <muu/meta.h>
template <typename T, bool AddVolatile>
using conditionally_add_volatile = std:: conditional_t<AddVolatile, add_volatile<T>, T>
Shorthand for conditionally adding volatile to a type or reference.
#include <muu/meta.h>
template <typename T, typename CopyFrom>
using copy_const = set_const<T, is_const<CopyFrom>>
Copies the constness (or lack thereof) from one type or reference to another.
#include <muu/meta.h>
template <typename T, typename CopyFrom>
using copy_cv = copy_const<copy_volatile<T, CopyFrom>, CopyFrom>
Copies consteness and volatility (or lack thereof) from one type or reference to another.
#include <muu/meta.h>
template <typename T, typename CopyFrom>
using copy_cvref = copy_ref<copy_cv<std:: remove_reference_t<T>, std:: remove_reference_t<CopyFrom>>, CopyFrom>
Copies consteness, volatility and reference category (or lack thereof) from one type or to another.
#include <muu/meta.h>
template <typename T, typename CopyFrom>
using copy_ref = typename impl::copy_ref_<T, CopyFrom>::type
Copies the reference category (or lack thereof) from one type or to another.
#include <muu/meta.h>
template <typename T, typename CopyFrom>
using copy_signed = set_signed<T, is_signed<CopyFrom>>
Copies the signed-ness (or lack thereof) from one numeric type or reference to another.
#include <muu/meta.h>
template <typename T, typename CopyFrom>
using copy_unsigned = set_unsigned<T, is_unsigned<CopyFrom>>
Copies the unsigned-ness (or lack thereof) from one numeric type or reference to another.
#include <muu/meta.h>
template <typename T, typename CopyFrom>
using copy_volatile = set_volatile<T, is_volatile<CopyFrom>>
Copies the volatility (or lack thereof) from one type or reference to another.
#include <muu/meta.h>
template <typename T>
using demote_if_large_float = std:: conditional_t<impl::is_large_float_<T>, typename impl::rebase_ref_<T, copy_cv<long double, T>>::type, T>
Demotes 'large' extended arithmetic floating-point types (e.g. __float128) to long double
.
#include <muu/meta.h>
template <typename... T>
using epsilon_type = impl::std_math_common_type<remove_cvref<T>...>
A common epsilon type when comparing floating-point types named by T.
#include <muu/meta.h>
template <size_t N>
using index_tag = std:: integral_constant<size_t, N>
A tag type for encoding/parameterizing a single index.
#include <muu/meta.h>
template <typename T, typename... U>
using largest = typename impl::largest_<T, U...>::type
The largest type from a set of types.
#include <muu/meta.h>
template <typename T, typename... U>
using least_aligned = typename impl::least_aligned_<T, U...>::type
The type with the smallest alignment (i.e. having the smallest value for alignment_of<T>
) from a set of types.
#include <muu/meta.h>
template <typename T>
using make_cref = std:: add_lvalue_reference_t<std:: add_const_t<remove_cvref<T>>>
Makes a type into a const lvalue reference (replacing existing cvref qualifiers).
#include <muu/meta.h>
template <typename T>
using make_signed = typename impl::make_signed_<T>::type
Converts a numeric type to the signed equivalent with the same rank.
#include <muu/meta.h>
template <typename T>
using make_unsigned = typename impl::make_unsigned_<T>::type
Converts a numeric type to the unsigned equivalent with the same rank.
#include <muu/meta.h>
template <typename T, typename... U>
using most_aligned = typename impl::most_aligned_<T, U...>::type
The type with the largest alignment (i.e. having the largest value for alignment_of<T>
) from a set of types.
#include <muu/meta.h>
template <typename T>
using promote_if_small_float = std:: conditional_t<impl::is_small_float_<T>, typename impl::rebase_ref_<T, copy_cv<float, T>>::type, T>
Promotes 'small' extended arithmetic floating-point types (e.g. __fp16, etc.) to float
.
#include <muu/meta.h>
template <typename T>
using readonly_param = typename impl::readonly_param_<std:: remove_reference_t<T>>::type
Resolves to T
or const T&
based on the performance characteristics of T
being passed by value into a function.
This trait examines things like:
- Is
T
an integer/float/pointer/enum/'scalar' type? - Is
T
trivially copyable or nothrow copyable? - Is
T
large or small?
#include <muu/meta.h>
template <typename Ptr, typename NewBase>
using rebase_pointer = typename impl::rebase_pointer_<Ptr, NewBase>::type
Rebases a pointer, preserving the const and volatile qualification of the pointed type.
#include <muu/meta.h>
template <typename T>
using remove_all_pointers = typename impl::remove_all_pointers_<T>::type
Strips every level of pointer from a type.
#include <muu/meta.h>
template <typename T>
using remove_callconv = copy_cvref<typename impl::remove_callconv_<remove_cvref<T>>::type, T>
Removes any explicit calling convention specifiers from functions, function pointers and function references.
#include <muu/meta.h>
template <typename T>
using remove_const = typename impl::rebase_ref_<T, std:: remove_const_t<std:: remove_reference_t<T>>>::type
Removes the topmost const qualifier from a type or reference.
#include <muu/meta.h>
template <typename T>
using remove_cv = typename impl::rebase_ref_<T, std:: remove_volatile_t<std:: remove_const_t<std:: remove_reference_t<T>>>>::type
Removes the topmost const and volatile qualifiers from a type or reference.
#include <muu/meta.h>
template <typename T>
using remove_cvref = std:: remove_cv_t<std:: remove_reference_t<T>>
Removes the topmost const, volatile and reference qualifiers from a type.
#include <muu/meta.h>
template <typename T>
using remove_enum = typename impl::remove_enum_<T>::type
Removes the outer enum wrapper from a type, converting it to the underlying integer equivalent.
#include <muu/meta.h>
template <typename T>
using remove_lvalue_reference = typename impl::remove_lvalue_reference_<T>::type
Removes reference qualification from a type if (and only if) it is an lvalue reference.
#include <muu/meta.h>
template <typename T>
using remove_noexcept = copy_cvref<typename impl::remove_noexcept_<remove_cvref<T>>::type, T>
Removes any noexcept
specifier from a functional type (or reference to one).
#include <muu/meta.h>
template <typename T>
using remove_rvalue_reference = typename impl::remove_rvalue_reference_<T>::type
Removes reference qualification from a type if (and only if) it is an rvalue reference.
#include <muu/meta.h>
template <typename T>
using remove_volatile = typename impl::rebase_ref_<T, std:: remove_volatile_t<std:: remove_reference_t<T>>>::type
Removes the topmost volatile qualifier from a type or reference.
#include <muu/meta.h>
template <typename T, bool Const>
using set_const = std:: conditional_t<Const, add_const<T>, remove_const<T>>
Sets the constness of a type or reference according to a boolean.
#include <muu/meta.h>
template <typename T, bool ConstVolatile>
using set_cv = std:: conditional_t<ConstVolatile, add_cv<T>, remove_cv<T>>
Sets the constness and volatility of a type or reference according to a boolean.
#include <muu/meta.h>
template <typename T, bool Signed>
using set_signed = std:: conditional_t<Signed, make_signed<T>, make_unsigned<T>>
Sets the signed-ness of a numeric type or reference according to a boolean.
#include <muu/meta.h>
template <typename T, bool Unsigned>
using set_unsigned = std:: conditional_t<Unsigned, make_unsigned<T>, make_signed<T>>
Sets the unsigned-ness of a numeric type or reference according to a boolean.
#include <muu/meta.h>
template <typename T, bool Volatile>
using set_volatile = std:: conditional_t<Volatile, add_volatile<T>, remove_volatile<T>>
Sets the volatility of a type or reference according to a boolean.
#include <muu/meta.h>
template <size_t Bits>
using signed_integer = typename decltype(impl::sint_for_bits_impl<Bits>())::type
Gets the signed integer type with a specific number of bits for the target platform.
#include <muu/meta.h>
template <typename T, typename... U>
using smallest = typename impl::smallest_<T, U...>::type
The smallest type from a set of types.
#include <muu/meta.h>
template <auto I, typename... T>
using type_at_index = /* ... */
The type at the given index in the list.
#include <muu/meta.h>
template <typename T>
using type_identity = typename impl::type_identity_<T>::type
Provides an identity type transformation.
#include <muu/type_list.h>
template <typename T>
using type_tag = type_list<T>
A tag type for encoding/parameterizing a single type.
#include <muu/meta.h>
template <size_t Bits>
using unsigned_integer = typename decltype(impl::uint_for_bits_impl<Bits>())::type
Gets the unsigned integer type with a specific number of bits for the target platform.
#include <muu/meta.h>
template <typename T>
using vector_param = typename impl::vector_param_<std:: remove_reference_t<T>>::type
Same as readonly___vectorcall
into account.
using w_axis_tag = index_tag<3>
#include <muu/meta.h>
An index_tag specialization for representing the W axis.
using x_axis_tag = index_tag<0>
#include <muu/meta.h>
An index_tag specialization for representing the X axis.
using y_axis_tag = index_tag<1>
#include <muu/meta.h>
An index_tag specialization for representing the Y axis.
using z_axis_tag = index_tag<2>
#include <muu/meta.h>
An index_tag specialization for representing the Z axis.
Variable documentation
#include <muu/meta.h>
template <typename T>
size_t alignment_of constexpr
The default alignment of a type.
#include <muu/meta.h>
template <typename... T>
bool all_arithmetic constexpr
Are all of the named types arithmetic or reference-to-arithmetic?
#include <muu/meta.h>
template <typename... T>
bool all_array constexpr
Are all of the named types arrays, or references to arrays?
#include <muu/meta.h>
template <typename... T>
bool all_bounded_array constexpr
Are all of the named types a bounded array (T[N]
), or a reference to one?
#include <muu/meta.h>
template <typename... T>
bool all_const constexpr
Are all of the named types const or reference-to-const?
#include <muu/meta.h>
template <typename To, typename... From>
bool all_convertible_to constexpr
True if all of the types named by From
are implicitly or explicitly convertible to To
.
#include <muu/meta.h>
template <typename... T>
bool all_cv constexpr
Are all of the named types const and/or volatile-qualified, or references to const and/or volatile-qualified?
#include <muu/meta.h>
template <typename... T>
bool all_cvref constexpr
Are all of the named types const, volatile, or a reference?
#include <muu/meta.h>
template <typename... T>
bool all_enum constexpr
Are all of the named types enums or reference-to-enum?
#include <muu/meta.h>
template <typename To, typename... From>
bool all_explicitly_convertible_to constexpr
True if all of the types named by From
are explicitly convertible to To
.
#include <muu/meta.h>
template <typename To, typename... From>
bool all_explicitly_nothrow_convertible_to constexpr
True if all of the types named by From
are explicitly nothrow-convertible to To
.
#include <muu/meta.h>
template <typename... T>
bool all_floating_point constexpr
Are all of the named types floating-point or reference-to-floating-point?
#include <muu/meta.h>
template <typename... T>
bool all_function constexpr
Are all of the named types free/static functions, or references to them?
#include <muu/meta.h>
template <typename... T>
bool all_function_pointer constexpr
Are all of the named types free/static function pointers, or references to them?
#include <muu/meta.h>
template <typename To, typename... From>
bool all_implicitly_convertible_to constexpr
True if all of the types named by From
are implicitly convertible to To
.
#include <muu/meta.h>
template <typename To, typename... From>
bool all_implicitly_nothrow_convertible_to constexpr
True if all of the types named by From
are implicitly nothrow-convertible to To
.
#include <muu/meta.h>
template <typename... T>
bool all_integer constexpr
Are all of the named types arithmetic integers, or reference to them?
#include <muu/meta.h>
template <typename... T>
bool all_integral constexpr
Are all of the named types integral or reference-to-integral?
#include <muu/meta.h>
template <typename... T>
bool all_legacy_enum constexpr
Are all of the named types pre-C++11 unscoped enums, or references to one?
#include <muu/meta.h>
template <typename To, typename... From>
bool all_nothrow_convertible_to constexpr
True if all of the types named by From
are implicitly or explicitly nothrow-convertible to To
.
#include <muu/meta.h>
template <typename T, typename... U>
bool all_same constexpr
True if all the named types are exactly the same.
#include <muu/meta.h>
template <typename... T>
bool all_scoped_enum constexpr
Are all of the named types C++11 scoped enum classes, or references to one?
#include <muu/meta.h>
template <typename... T>
bool all_signed constexpr
Are all of the named types signed or reference-to-signed?
#include <muu/meta.h>
template <typename... T>
bool all_unbounded_array constexpr
Are all of the named types an unbounded array (T[]
), or a reference to one?
#include <muu/meta.h>
template <typename... T>
bool all_unsigned constexpr
Are all of the named types unsigned or reference-to-unsigned?
#include <muu/meta.h>
template <typename... T>
bool all_volatile constexpr
Are all of the named types volatile or reference-to-volatile?
#include <muu/fwd.h>
template <typename From, typename To>
bool allow_implicit_bit_cast constexpr
Allows the library to implicitly convert via bit casting in some situations.
Template parameters | |
---|---|
From | The source type. |
To | The destination type. |
#include <muu/vector.h> using vec3i = muu::vector<int, 3>; struct Foo { int a, b, c; }; namespace muu { template <> inline constexpr bool allow_implicit_bit_cast<Foo, vec3i> = true; }; Foo foo{ 1, 2, 3 }; vec3i bar = foo;
#include <muu/meta.h>
template <typename... T>
bool always_false constexpr
Evaluates to false but with delayed, type-dependent evaluation.
Allows you to do things like this:
if constexpr (is_fancy_type<T>) // ... else static_assert(always_false<T>, "Oh no, T wasn't fancy enough!");
#include <muu/meta.h>
template <typename... T>
bool any_arithmetic constexpr
Are any of the named types arithmetic or reference-to-arithmetic?
#include <muu/meta.h>
template <typename... T>
bool any_array constexpr
Are any of the named types arrays, or references to arrays?
#include <muu/meta.h>
template <typename... T>
bool any_bounded_array constexpr
Are any of the named types a bounded array (T[N]
), or a reference to one?
#include <muu/meta.h>
template <typename... T>
bool any_const constexpr
Are any of the named types const or reference-to-const?
#include <muu/meta.h>
template <typename... T>
bool any_cv constexpr
Are any of the named types const and/or volatile-qualified, or references to const and/or volatile-qualified?
#include <muu/meta.h>
template <typename... T>
bool any_cvref constexpr
Are any of the named types const, volatile, or a reference?
#include <muu/meta.h>
template <typename... T>
bool any_enum constexpr
Are any of the named types enums or reference-to-enum?
#include <muu/meta.h>
template <typename... T>
bool any_floating_point constexpr
Are any of the named types floating-point or reference-to-floating-point?
#include <muu/meta.h>
template <typename... T>
bool any_function constexpr
Are any of the named types free/static functions, or references to them?
#include <muu/meta.h>
template <typename... T>
bool any_function_pointer constexpr
Are any of the named types free/static function pointers, or references to them?
#include <muu/meta.h>
template <typename... T>
bool any_integer constexpr
Are any of the named types arithmetic integers, or reference to them?
#include <muu/meta.h>
template <typename... T>
bool any_integral constexpr
Are any of the named types integral or reference-to-integral?
#include <muu/meta.h>
template <typename... T>
bool any_legacy_enum constexpr
Are any of the named types pre-C++11 unscoped enums, or references to one?
#include <muu/meta.h>
template <typename T, typename... U>
bool any_same constexpr
True if T is exactly the same as one or more of the types named by U.
#include <muu/meta.h>
template <typename... T>
bool any_scoped_enum constexpr
Are any of the named types C++11 scoped enum classes, or references to one?
#include <muu/meta.h>
template <typename... T>
bool any_signed constexpr
Are any of the named types signed or reference-to-signed?
#include <muu/meta.h>
template <typename... T>
bool any_unbounded_array constexpr
Are any of the named types an unbounded array (T[]
), or a reference to one?
#include <muu/meta.h>
template <typename... T>
bool any_unsigned constexpr
Are any of the named types unsigned or reference-to-unsigned?
#include <muu/meta.h>
template <typename... T>
bool any_volatile constexpr
Are any of the named types volatile or reference-to-volatile?
#include <muu/meta.h>
template <typename T>
size_t arity constexpr
Returns the arity (parameter count) of a function, function pointer, stateless lambda, or class/union type with an unambiguous operator()
overload.
#include <muu/meta.h>
template <typename T>
bool decays_to_function_pointer_by_unary_plus constexpr
Evaluates to true if an instance of T
decays to a free-function pointer by explicit unary plus.
#include <muu/meta.h>
template <typename T>
bool decays_to_pointer_by_unary_plus constexpr
Evaluates to true if an instance of T
decays to a pointer by explicit unary plus.
#include <muu/meta.h>
template <typename... T>
epsilon_type<T...> default_epsilon constexpr
The default floating-point epsilon value used when comparing floating-point types named by T.
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_addition_operator constexpr
True if a pair of types has an addition operator (T + U
).
#include <muu/meta.h>
template <typename T>
bool has_arrow_operator constexpr
True if a type has an arrow operator (T->
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_bitwise_and_operator constexpr
True if a pair of types has a bitwise AND operator (T & U
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_bitwise_lsh_operator constexpr
True if a pair of types has a bitwise left-shift operator (T << U
).
#include <muu/meta.h>
template <typename T>
bool has_bitwise_not_operator constexpr
True if a type has a unary bitwise NOT operator (~T
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_bitwise_or_operator constexpr
True if a pair of types has a bitwise OR operator (T | U
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_bitwise_rsh_operator constexpr
True if a pair of types has a bitwise right-shift operator (T >> U
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_bitwise_xor_operator constexpr
True if a pair of types has a bitwise XOR operator (T ^ U
).
#include <muu/meta.h>
template <typename T>
bool has_data_member_function constexpr
True if a type has a member function data()
returning a pointer.
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_division_operator constexpr
True if a pair of types has a division operator (T / U
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_equality_operator constexpr
True if a pair of types has an equality operator (T == U
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_greater_than_operator constexpr
True if a pair of types has a greater-than operator (T > U
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_greater_than_or_equal_operator constexpr
True if a pair of types has a greater-than-or-equal operator (T >= U
).
#include <muu/meta.h>
template <typename T>
bool has_indirection_operator constexpr
True if a type has an indirection operator (*T
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_inequality_operator constexpr
True if a pair of types has an inequality operator (T != U
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_less_than_operator constexpr
True if a pair of types has a less-than operator (T < U
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_less_than_or_equal_operator constexpr
True if a pair of types has a less-than-or-equal operator (T <= U
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_logical_and_operator constexpr
True if a pair of types has a logical AND operator (T && U
).
#include <muu/meta.h>
template <typename T>
bool has_logical_not_operator constexpr
True if a type has a unary logical NOT operator (!T
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_logical_or_operator constexpr
True if a pair of types has a logical OR operator (T || U
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_modulo_operator constexpr
True if a pair of types has an modulo operator (T % U
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_multiplication_operator constexpr
True if a pair of types has a multiplication operator (T * U
).
#include <muu/meta.h>
template <typename T>
bool has_post_decrement_operator constexpr
True if a type has a post-decrement operator (T--
).
#include <muu/meta.h>
template <typename T>
bool has_post_increment_operator constexpr
True if a type has a post-increment operator (T++
).
#include <muu/meta.h>
template <typename T>
bool has_pre_decrement_operator constexpr
True if a type has a pre-decrement operator (--T
).
#include <muu/meta.h>
template <typename T>
bool has_pre_increment_operator constexpr
True if a type has a pre-increment operator (++T
).
#include <muu/meta.h>
template <typename T>
bool has_size_member_function constexpr
True if a type has a member function size()
returning an arithmetic integral type.
#include <muu/meta.h>
template <typename T, typename U = size_t>
bool has_subscript_operator constexpr
True if a pair of types has a subscript operator (T[U]
).
#include <muu/meta.h>
template <typename T, typename U = T>
bool has_subtraction_operator constexpr
True if a pair of types has a subtraction operator (T - U
).
#include <muu/meta.h>
template <typename T>
bool has_unambiguous_function_call_operator constexpr
True if a type has single non-template operator() overload.
#include <muu/meta.h>
template <typename T>
bool has_unary_minus_operator constexpr
True if a type has a unary minus operator (-T
).
#include <muu/meta.h>
template <typename T>
bool has_unary_plus_operator constexpr
True if a type has a unary plus operator (+T
).
#include <muu/meta.h>
template <typename T, typename U, typename... V>
size_t index_of_type constexpr
The index of the first appearance of the type T in the type list [U, V...].
#include <muu/meta.h>
template <typename Child, typename Parent>
bool inherits_from constexpr
Does Child inherit from Parent?
#include <muu/meta.h>
template <typename Child, typename Parent, typename... Parents>
bool inherits_from_all constexpr
Does Child inherit from all of the types named by Parent?
#include <muu/meta.h>
template <typename Child, typename Parent, typename... Parents>
bool inherits_from_any constexpr
Does Child inherit from any of the types named by Parent?
#include <muu/meta.h>
template <typename T>
bool is_arithmetic constexpr
Is a type arithmetic or reference-to-arithmetic?
#include <muu/meta.h>
template <typename T>
bool is_array constexpr
Is a type an array, or reference to one?
#include <muu/meta.h>
template <typename T>
bool is_bounded_array constexpr
Is a type a bounded array (T[N]
), or reference to one?
#include <muu/meta.h>
template <typename T>
bool is_character constexpr
Is a type a built-in text character (code unit) type, or reference to one?
#include <muu/meta.h>
template <typename T>
bool is_code_unit constexpr
Is a type a built-in text code unit (character) type, or reference to one?
#include <muu/meta.h>
template <typename T>
bool is_const constexpr
Is a type const or reference-to-const?
#include <muu/meta.h>
template <typename From, typename To>
bool is_convertible constexpr
True if From
is implicitly or explicitly convertible to To
.
#include <muu/meta.h>
template <typename From, typename... To>
bool is_convertible_to_all constexpr
True if From
is implicitly or explicitly convertible to all of the types named by To
.
#include <muu/meta.h>
template <typename From, typename... To>
bool is_convertible_to_any constexpr
True if From
is implicitly or explicitly convertible to any of the types named by To
.
#include <muu/meta.h>
template <typename T>
bool is_cv constexpr
Is a type const and/or volatile-qualified?
#include <muu/meta.h>
template <typename T>
bool is_cvref constexpr
Is a type const, volatile, or a reference?
#include <muu/meta.h>
template <template<typename...> typename Trait, typename... Args>
auto is_detected constexpr
Detects if a type supports an interface.
#include <muu/meta.h>
template <typename T>
bool is_enum constexpr
Is a type an enum or reference-to-enum?
#include <muu/meta.h>
template <typename From, typename To>
bool is_explicitly_convertible constexpr
True if From
is explicitly convertible to To
.
#include <muu/meta.h>
template <typename From, typename... To>
bool is_explicitly_convertible_to_all constexpr
True if From
is explicitly convertible to all of the types named by To
.
#include <muu/meta.h>
template <typename From, typename... To>
bool is_explicitly_convertible_to_any constexpr
True if From
is explicitly convertible to any of the types named by To
.
#include <muu/meta.h>
template <typename From, typename To>
bool is_explicitly_nothrow_convertible constexpr
True if From
is explicitly nothrow-convertible to To
.
#include <muu/meta.h>
template <typename From, typename... To>
bool is_explicitly_nothrow_convertible_to_all constexpr
True if From
is explicitly nothrow-convertible to all of the types named by To
.
#include <muu/meta.h>
template <typename From, typename... To>
bool is_explicitly_nothrow_convertible_to_any constexpr
True if From
is explicitly nothrow-convertible to any of the types named by To
.
#include <muu/meta.h>
template <typename T>
bool is_extended_arithmetic constexpr
Is a type a nonstandard 'extended' arithmetic type, or a reference to one?
#include <muu/meta.h>
template <typename T>
bool is_floating_point constexpr
Is a type a floating-point or reference-to-floating-point?
#include <muu/meta.h>
template <typename T>
bool is_function constexpr
Is a type a free/static function, or reference to one?
#include <muu/meta.h>
template <typename T>
bool is_function_pointer constexpr
Is a type a free/static function pointer, or reference to one?
#include <muu/meta.h>
template <typename From, typename To>
bool is_implicitly_convertible constexpr
True if From
is implicitly convertible to To
.
#include <muu/meta.h>
template <typename From, typename... To>
bool is_implicitly_convertible_to_all constexpr
True if From
is implicitly convertible to all of the types named by To
.
#include <muu/meta.h>
template <typename From, typename... To>
bool is_implicitly_convertible_to_any constexpr
True if From
is implicitly convertible to any of the types named by To
.
#include <muu/meta.h>
template <typename From, typename To>
bool is_implicitly_nothrow_convertible constexpr
True if From
is implicitly nothrow-convertible to To
.
#include <muu/meta.h>
template <typename From, typename... To>
bool is_implicitly_nothrow_convertible_to_all constexpr
True if From
is implicitly nothrow-convertible to all of the types named by To
.
#include <muu/meta.h>
template <typename From, typename... To>
bool is_implicitly_nothrow_convertible_to_any constexpr
True if From
is implicitly nothrow-convertible to any of the types named by To
.
#include <muu/meta.h>
template <typename T>
bool is_integer constexpr
Is a type an arithmetic integer type, or reference to one?
#include <muu/meta.h>
template <typename T>
bool is_integral constexpr
Is a type an integral type or a reference to an integral type?
#include <muu/meta.h>
template <typename T>
bool is_iterable constexpr
Returns true if a type is a bounded array or a class type having begin()
and end()
iterators (as members, in the std
namespace, or found via ADL).
#include <muu/meta.h>
template <typename T>
bool is_legacy_enum constexpr
Is a type a pre-C++11 unscoped enum, or reference to one?
#include <muu/meta.h>
template <typename T>
bool is_mutex_like constexpr
True if a type has a lock interface compatible with std::
#include <muu/meta.h>
template <typename From, typename To>
bool is_nothrow_convertible constexpr
True if From
is implicitly or explicitly nothrow-convertible to To
.
#include <muu/meta.h>
template <typename From, typename... To>
bool is_nothrow_convertible_to_all constexpr
True if From
is implicitly or explicitly nothrow-convertible to all of the types named by To
.
#include <muu/meta.h>
template <typename From, typename... To>
bool is_nothrow_convertible_to_any constexpr
True if From
is implicitly or explicitly nothrow-convertible to any of the types named by To
.
#include <muu/meta.h>
template <typename T>
bool is_scoped_enum constexpr
Is a type a C++11 scoped enum class, or reference to one?
#include <muu/meta.h>
template <typename T>
bool is_shared_mutex_like constexpr
True if a type has a lock interface compatible with std::
#include <muu/meta.h>
template <typename T>
bool is_signed constexpr
Is a type signed or reference-to-signed?
#include <muu/meta.h>
template <typename T>
bool is_standard_arithmetic constexpr
Is a type one of the standard c++ arithmetic types, or a reference to one?
#include <muu/meta.h>
template <typename T, typename CompatibleWithFunc = void>
bool is_stateless_lambda constexpr
Evaluates to true if T
is a stateless lambda type, or a reference to one.
#include <muu/meta.h>
template <typename T>
bool is_trivially_manifestable constexpr
Evaluates to true if T
is an empty class/union with trivial default constructor and destructor, or a reference to one.
#include <muu/meta.h>
template <typename T>
bool is_tuple_like constexpr
True if the type implements std::tuple_size and std::tuple_element.
#include <muu/meta.h>
template <typename T>
bool is_unbounded_array constexpr
Is a type an unbounded array (T[]
), or reference to one?
#include <muu/meta.h>
template <typename T>
bool is_unsigned constexpr
Is a type unsigned or reference-to-unsigned?
#include <muu/meta.h>
template <typename T>
bool is_volatile constexpr
Is a type volatile or reference-to-volatile?
#include <muu/meta.h>
template <typename T>
size_t pointer_rank constexpr
The rank of a pointer.
#include <muu/meta.h>
template <typename... T>
size_t total_size constexpr
The sum of sizeof()
for all of the types named by T.
#include <muu/meta.h>
template <typename T>
size_t tuple_size constexpr
Equivalent to std::tuple_size_v, but safe to use in SFINAE contexts.
#include <muu/type_name.h>
template <typename T>
auto type_name constexpr
A muu::
std::cout << muu::type_name<int> << "\n";
int
Specialize the variable template if you wish to override the default name for a type:
struct foo {}; namespace muu { template <> inline constexpr auto type_name<foo> = fixed_string{ "bar" }; } std::cout << muu::type_name<foo> << "\n"; std::cout << muu::type_name<foo*> << "\n";
bar bar*
#include <muu/type_name.h>
template <typename... T>
auto type_name_list constexpr
A muu::
std::cout << muu::type_name_list<int, float, char> << "\n";
int, float, char