Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
type_traits: Compile-Time Queries For Properties of Types

The type traits sub-package provides a series of class and variable templates that describe properties of their template parameters, akin to the type traits provided by the C++ Standard Library. Some of these are back-ported from later versions of the C++ Standard, while others are provided as extensions.

The public header is

Public export header for content from arene/base/type_traits.

The Bazel target is

//:type_traits

Back-ported C++ Standard Library Traits

The type_traits sub-package provides the following type traits which are backports of traits from the C++ Standard Library:

Value or Type Trait class and Trait Variable or Type Alias Summary
Type arene::base::type_identity and arene::base::type_identity_t Backport of std::type_identity and std::type_identity_t. Provides an alias for a type name that can be used to prevent template argument deduction
Value arene::base::is_invocable and arene::base::is_invocable_v Backport of std::is_invocable and std::is_invocable_v. Check if a function or type can be invoked with the specified argument list
Value arene::base::is_invocable_r and arene::base::is_invocable_r_v Backport of std::is_invocable_r and std::is_invocable_r_v. Check if a function or type can be invoked with the specified argument list, returning something convertible to the specified type
Value arene::base::is_nothrow_invocable and arene::base::is_nothrow_invocable_v Backport of std::is_nothrow_invocable and std::is_nothrow_invocable_v. Check if a function or type can be invoked with the specified argument list, without throwing
Value arene::base::is_nothrow_invocable_r and arene::base::is_nothrow_invocable_r_v Backport of std::is_nothrow_invocable_r and std::is_nothrow_invocable_r_v. Check if a function or type can be invoked with the specified argument list, returning something convertible to the specified type, without throwing
Type arene::base::remove_cv_t Backport of std::remove_cv and std::remove_cv_t. Removes const and volatile qualifiers from a type
Type arene::base::remove_reference_t Backport of std::remove_reference and std::remove_reference_t. Converts a reference to a non-reference
Type arene::base::remove_cvref and arene::base::remove_cvref_t Backport of std::remove_cvref and std::remove_cvref_t. Removes const and volatile qualifiers from a type and converts a reference to a non-reference
Type arene::base::void_t Backport of std::void_t. An alias for void that ensures the template parameters are valid types
Value arene::base::is_swappable_v Backport of std::is_swappable and std::is_swappable_v. A type is swappable if it satisfies either arene::base::is_adl_swappable or arene::base::is_default_swappable
Value arene::base::is_nothrow_swappable_v Backport of std::is_nothrow_swappable and std::is_nothrow_swappable_v. A type is nothrow swappable if it satisfies either arene::base::is_adl_nothrow_swappable, or it does not satisfy arene::base::is_adl_swappable and satisfies arene::base::is_nothrow_default_swappable
Type arene::base::unwrap_reference and arene::base::unwrap_reference_t Backport of std::unwrap_reference. Converts a std::reference_wrapper into the reference type which is logically wraps.
Type arene::base::unwrap_ref_decay and arene::base::unwrap_ref_decay_t Backport of std::unwrap_ref_decay. Decays a type and then applies unwrap_reference to it. This construction is used in some standard facilities which take generic construction parameters and use them to deduce value types, like in std::make_tuple.
Value arene::base::conjunction and arene::base::conjunction_v Backport of std::conjunction and std::conjunction_v. Performs a logical AND of a set of boolean traits.
Value arene::base::disjunction and arene::base::disjunction_v Backport of std::disjunction and std::disjunction_v. Performs a logical OR of a set of boolean traits.
Value arene::base::negation and arene::base::negation_v Backport of std::negation and std::negation_v. Performs a logical NOT on a boolean trait.

Additional Type Traits

The type_traits sub-package also provides the following additional type traits:

Value or Type Trait class and Variable or Type Alias Summary
Value arene::base::always_false_v A bool value that is false for all input types.
Value arene::base::all_are_same_v A bool value that is true if all the template parameters are the same type, false otherwise.
Value arene::base::all_of_v A bool value that is true if all the template parameters are true, and false otherwise.
Value arene::base::any_of_v A bool value that is true if any of the template parameters are true, and false otherwise.
Value arene::base::none_of_v A bool value that is true if none of the template parameters are true, and false otherwise.
Value arene::base::is_one_of and arene::base::is_one_of_v A bool value that is true if the first template parameter is the same as any of the remaining template parameters, and false otherwise.
Value arene::base::is_equality_comparable_v A bool value that is true if an instance of the first template parameter can be compared with an instance of the second template parameter (which defaults to the same as the first) using ==, and false otherwise.
Value arene::base::is_inequality_comparable_v A bool value that is true if an instance of the first template parameter can be compared with an instance of the second template parameter (which defaults to the same as the first) using !=, and false otherwise.
Value arene::base::is_less_than_comparable_v A bool value that is true if an instance of the first template parameter can be compared with an instance of the second template parameter (which defaults to the same as the first) using <, and false otherwise.
Value arene::base::is_less_than_or_equal_comparable_v A bool value that is true if an instance of the first template parameter can be compared with an instance of the second template parameter (which defaults to the same as the first) using <=, and false otherwise.
Value arene::base::is_greater_than_comparable_v A bool value that is true if an instance of the first template parameter can be compared with an instance of the second template parameter (which defaults to the same as the first) using >, and false otherwise.
Value arene::base::is_greater_than_or_equal_comparable_v A bool value that is true if an instance of the first template parameter can be compared with an instance of the second template parameter (which defaults to the same as the first) using >=, and false otherwise.
Value arene::base::is_array_convertible and arene::base::is_array_convertible_v A bool value that is true if a pointer to an array of the first template argument can be converted to a pointer to an array of the second template argument.
Value arene::base::is_instantiation_of_v A bool value that is true if the first argument (a type) is an instantiation of the second argument (a template). e.g. arene::base::is_instantiation_of_v<std::string, std::vector> is false, but arene::base::is_instantiation_of_v<std::vector<int>, std::vector> is true
Value arene::base::is_reference_wrapper_v A bool value that is true if the template parameter is an instantiation of std::reference_wrapper, false otherwise.
Value arene::base::is_one_of and arene::base::is_one_of_v A bool value that is true if the first template parameter is the same as any of the remaining template parameters, and false otherwise.
Value arene::base::decays_to_v A bool value that is true if the first template parameter decays to the second template parameter, and false otherwise.
Value arene::base::denotes_range_v A bool value that is true if the template parameters form a valid Iterator/Sentinel pair for denoting an iterable range, and false otherwise.
Value arene::base::denotes_nothrow_iterable_range_v A bool value that is true if the template parameters form a valid Iterator/Sentinel pair for denoting an iterable range, and the operations on those types for iterating through the range (++, * and !=) are noexcept, and false otherwise.
Value arene::base::index_of and arene::base::index_of_v A std::size_t value that is the first index of the first template parameter within the remaining template parameters. arene::base::index_of has no value, and arene::base::index_of_v is ill-formed if the type being searched for is not within the list.
Value arene::base::last_index_of and arene::base::last_index_of_v A std::size_t value that is the last index of the first template parameter within the remaining template parameters. arene::base::last_index_of has no value, and arene::base::last_index_of_v is ill-formed if the type being searched for is not within the list.
Type arene::base::member_pointer_class_type A type alias for the class type for which the supplied template parameter is a pointer to member. Ill-formed if the supplied template parameter is not a pointer-to-class-member
Value arene::base::is_output_iterator_v A bool value that is true if the template parameter is a valid Output Iterator, false otherwise.
Value arene::base::is_input_iterator_v A bool value that is true if the template parameter is a valid Input Iterator, false otherwise.
Value arene::base::is_forward_iterator_v A bool value that is true if the template parameter is a valid Forward Iterator, false otherwise.
Value arene::base::is_bidirectional_iterator_v A bool value that is true if the template parameter is a valid Bidirectional Iterator, false otherwise.
Value arene::base::is_random_access_iterator_v A bool value that is true if the template parameter is a valid Random Access Iterator, false otherwise.
Value arene::base::is_iterator_v A bool value that is true if the template parameter is a valid Iterator (of any category), false otherwise.
Value arene::base::has_overloaded_address_operator_v A bool value that is true if the template parameter has any form of overloaded address operator (which would be banned by our coding standard), false otherwise.
Value arene::base::is_default_swappable_v Query for if a type satisfies std::is_move_constructable and std::is_move_assignable, which are the requirements for the default swap implementation (both arene::base::swap and std::swap)
Value arene::base::is_nothrow_default_swappable_v Query for if a type satisfies std::is_nothrow_move_constructable and std::is_nothrow_move_assignable, which are the requirements for the default swap implementation (both arene::base::swap and std::swap) to be noexcept
Value arene::base::is_adl_swappable_v Query for if swap(T&, T&) is discoverable when made via unqualified function call (ADL)
Value arene::base::is_nothrow_adl_swappable_v Query for if swap(T&, T&) is discoverable when made via unqualified function call (ADL), and the discovered function is noexcept
Value arene::base::is_transparent_comparator_v<C> Query for if C::is_transparent is a member typedef.
Value arene::base::is_transparent_comparator_for_v<C,T,U> Query equivalent to is_transparent_comparator_v<C> && is_invocable_r_v<bool,C,U>
Value arene::base::is_transparent_three_way_comparator_for_v<C,T,U> Query equivalent to is_transparent_comparator_v<C> && is_invocable_r_v<strong_ordering,C,U>
Value arene::base::is_addable_v A bool value that is true if an instance of the first template parameter can be added to an instance of the second template parameter (which defaults to the same as the first) using +, and false otherwise.
Value arene::base::is_nothrow_addable_v A bool value that is true if an instance of the first template parameter can be added to an instance of the second template parameter (which defaults to the same as the first) using +, without throwing an exception, and false otherwise.
Value arene::base::is_subtractable_v A bool value that is true if an instance of the second template parameter can be subtracted from an instance of the first template parameter (which defaults to the same as the first) using -, and false otherwise.
Value arene::base::is_nothrow_subtractable_v A bool value that is true if an instance of the second template parameter can be subtracted from an instance of the first template parameter (which defaults to the same as the first) using -, without throwing an exception, and false otherwise.
Type arene::base::priority_tag A tag type used to control function overload resolution order.
Type arene::base::is_implicitly_constructible_v A bool value that is true if an instance of the first template parameter can be implicitly constructed from the rest of the template parameters.
Type arene::base::is_only_explicitly_constructible_v A bool value that is true if an instance of the first template parameter can only be explicitly constructed from the rest of the template parameters.
Type arene::base::is_tuple_like_v A bool value that is true if the template parameter implements the tuple protocol. Note that this is distinct from the standard exposition-only concept tuple-like, which is only true for a particular set of types.
Type arene::base::is_pair_like_v A bool value that is true if the template parameter is tuple-like in the sense of is_tuple_like_v and its std::tuple_size is equal to 2.