Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
arene::base Namespace Reference

Typedef Documentation

◆ combine_kinds_t

template<typename... Kinds>
using arene::base::combine_kinds_t
Initial value:
typename combine_kinds_detail::canonicalize_post_combining<
typename combine_kinds_detail::internal_combine_kinds<
combine_kinds_detail::normalize_for_combining_t<Kinds>...
>::type
>::type

Template alias to combine a list of quantity kinds.

Template Parameters
Kindsthe quantity kinds to combine

◆ compare_three_way

using arene::base::compare_three_way = three_way_compare_detail::compare_three_way

Function object that does a three-way comparison between operands, equivalent to std::compare_three_way .

◆ conditional_apply_t

template<bool B, template< class... > class OnTrue, template< class... > class OnFalse, class... Args>
using arene::base::conditional_apply_t = typename static_if<B>::template then_apply_else_apply<OnTrue, OnFalse, Args...>

lazily apply one of two template aliases based on a boolean condition

Template Parameters
Bthe boolean condition
OnTruetemplate alias applied to Args when B is true
OnFalsetemplate alias applied to Args when B is false
Argsparameter pack forwarded to the selected template alias

Only the selected branch's template is instantiated with Args. The other branch's template is never applied, avoiding unnecessary instantiations and potential ill-formed types.

Example:

// if T is void, apply std::add_pointer, otherwise return T as-is:
T
>;
A sum type which can hold either a value or an error. Similar to std::expected.
Definition result.hpp:104
static constexpr value_type value
Definition integral_constant.hpp:34
T conditional_identity_t
an identity alias intended for use as a no-op branch in conditional_apply_t
Definition conditional.hpp:43
typename static_if< B >::template then_apply_else_apply< OnTrue, OnFalse, Args... > conditional_apply_t
lazily apply one of two template aliases based on a boolean condition
Definition conditional.hpp:73
typename add_pointer< Type >::type add_pointer_t
Adds a pointer to the given type.
Definition add_pointer.hpp:62

◆ conditional_identity_t

template<class T>
using arene::base::conditional_identity_t = T

an identity alias intended for use as a no-op branch in conditional_apply_t

Template Parameters
Tthe type to return as-is

When used as the OnTrue or OnFalse template parameter of conditional_apply_t, it passes the argument through unchanged.

Note
std::type_identity_t is not suitable here because it is defined in terms of a class template (std::type_identity<T>::type), making it non-transparent. It cannot be redefined as a simple alias without breaking its common use as a type deduction barrier.

◆ conditional_t

template<bool B, class T, class F>
using arene::base::conditional_t = typename static_if<B>::template then_else<T, F>

lazily select between two types based on a boolean condition

Template Parameters
Bthe boolean condition
Tthe type selected when B is true
Fthe type selected when B is false

Unlike std::conditional_t, this does not eagerly instantiate both branches. Only the selected type is used; the other remains untouched.

Note
Serves as a drop-in replacement for std::conditional_t, backed by static_if for lazy evaluation.
A corresponding conditional class template is intentionally not provided, to avoid unecessary class template instantiations. If the type is necessary, use std::conditional.

◆ constraints

template<class... EnableIfs>
using arene::base::constraints = typename constraints_impl::constraints<EnableIfs...>::type

Helper used to express template constraints in a consistent way using std::enable_if_t.

Use with std::enable_if_t to group N short-circuited constraints without N top-level template parameters and without std::conjunction . This preserves error information while also minimizing extraneous template parameters. If we eventually move all users to C++20, we can remove this and use language-level concepts.

Usage Example:

/// @brief A function that is callable only with unsigned integers the same size or smaller than @c unsigned
/// @tparam T The type of the integer
/// @param arg The unsigned integral argument value
template <
class T,
std::enable_if_t<sizeof(T) <= sizeof(unsigned)>> = nullptr>
void foo(T arg);
Note
constraints is an alias to std::nullptr_t for two reasons. 1) It is unlikely that someone invoking the function-template will accidentally pass an explicit "nullptr" as a template argument the place that the constraints appear in the template parameter list. 2) There is only one possible value for a std::nullptr_t argument, so the choice for default argument value being nullptr is not subjective.

Users should prefer using constraints to form the template parameter kind as in the example, as opposed to using its result as a default argument for a class template parameter. This is so that constraints in overload sets do not conflict with each other as if redeclarations that differ only by default arguments.

◆ dextents

template<typename IndexType, std::size_t Rank>
using arene::base::dextents = typename extents_detail::dextents_helper<IndexType, std::integral_constant<std::size_t, Rank>>::type

Backport of std::dextents from C++23, a type representing the extents of a multidimensional array with all dynamic extents.

Template Parameters
IndexTypethe index type
RankThe number of dimensions of the array
Precondition
IndexType must be an integral type other than bool

◆ f32_t

using arene::base::f32_t = float

An alias to float.

◆ f64_t

using arene::base::f64_t = double

An alias to double.

◆ function_arguments_t

template<class Fn>
using arene::base::function_arguments_t = typename function_traits<Fn>::argument_types

Determines the argument types of a function.

Template Parameters
Fnfunction type

◆ function_return_t

template<class Fn>
using arene::base::function_return_t = typename function_traits<Fn>::return_type

Determines the return and argument types of a function.

Template Parameters
Fnfunction type

◆ function_traits

template<class Fn>
using arene::base::function_traits = typename function_traits_detail::function_traits_impl<Fn>

Contains the return_type, argument_type, and cv_qualifier of the given function type.

Template Parameters
FnFunction type to build traits from

◆ give_cv_to_t

template<class From, class To>
using arene::base::give_cv_to_t
Initial value:
give_cv_to_detail::give_volatile_to_t<
From,
give_cv_to_detail::give_const_to_t<
From,
To>>

Add the cv qualification from one type to another.

Template Parameters
Fromtype to copy cv-ref qualification from
Totype to copy cv-ref qualification to
Note
Does not decay To before adding cv qualification. If replacement semantics are desired, apply std::remove_cvref_t to To.

◆ give_cvref_to_t

template<class From, class To>
using arene::base::give_cvref_to_t
Initial value:
give_cvref_to_detail::give_reference_to<
From,
give_cv_to_detail::give_volatile_to_t< From, give_cv_to_detail::give_const_to_t< From, To > > give_cv_to_t
Add the cv qualification from one type to another.
Definition give_cv_to.hpp:67

Add the cv-ref qualification from one type to another.

Template Parameters
Fromtype to copy cv-ref qualification from
Totype to copy cv-ref qualification to
Note
Does not decay To before adding cv or ref qualification. If replacement semantics are desired, apply std::remove_cvref_t to To.

◆ give_qualifiers_to

template<class Source, class Target>
using arene::base::give_qualifiers_to
Initial value:
typename static_if<give_qualifiers_to_detail::is_volatile_v<Source>>::template then_apply_else_apply<
give_qualifiers_to_detail::give_qualifiers_to_impl_volatile,
give_qualifiers_to_detail::give_qualifiers_to_impl_nonvolatile,
Source,
Target>
A metaprogramming facility for selecting a branch statically without evaluating both branches apriori...
Definition static_if.hpp:48

For a type Source and type Target: if Source is const volatile results in Target const volatile otherwise if Source is volatile results in Target volatile otherwise if Source is const result in Target const otherwise results in Target.

Template Parameters
SourceThe type providing the qualifiers
TargetThe type to modify the qualifiers of

◆ int16_t

A 16-bit signed integer type.

◆ int32_t

A 32-bit signed integer type.

◆ int64_t

A 64-bit signed integer type.

◆ int8_t

An 8-bit signed integer type.

◆ integer_sequence_cat

template<typename... Sequences>
using arene::base::integer_sequence_cat = typename integer_sequence_ops_detail::integer_sequence_cat_impl<Sequences...>::type

Produces a single std::integer_sequence which is the concatenation of multiple std::integer_sequence.

Template Parameters
Sequencesthe sequence of std::integer_sequence to concatenate
Precondition
Each element in Sequences must be an instantiation of std::integer_sequence.
Returns
std::integer_sequence A single sequence that contains the elements from all sequences in Sequences, maintaining order of appearance.

◆ integer_sequence_unique_elements

template<typename Sequence>
using arene::base::integer_sequence_unique_elements
Initial value:
typename integer_sequence_ops_detail::
integer_sequence_merge_unique_elements_impl<std::integer_sequence<typename Sequence::value_type>, Sequence>::type

Create a new integer sequence with the unique values from the provided integer sequence. The values in the resultant sequence are in the order of their first occurrence in the provided sequence.

Template Parameters
Sequencethe provided integer sequence
Precondition
Sequence must be an instantiation of std::integer_sequence

◆ inverse_unit_scale_t

template<typename Type>
using arene::base::inverse_unit_scale_t = typename scaled_unit_detail::inverse_unit_scale_helper<Type>::type

A type that represents the inverse of a scale factor.

Template Parameters
Typethe type to invert

◆ invoke_result_t

template<typename Fn, typename... Args>
using arene::base::invoke_result_t = typename invoke_result<Fn, Args...>::type

The return type of a functor invoked with the specified arguments.

Template Parameters
FnThe functor type.
ArgsThe functor parameter types.

◆ is_implicitly_constructible

template<class T, class... Args>
using arene::base::is_implicitly_constructible
Initial value:
Args...>(priority_tag<1>{}))
A priority tag for overload resolution.
Definition priority_tag.hpp:43

Type trait to detect if a type is implicitly constructible from arguments of the specified types.

Template Parameters
TThe type to check if it can be implicitly constructed.
ArgsThe arguments to try to implicitly construct with.

◆ is_inline_buffer_string

template<typename Type>
using arene::base::is_inline_buffer_string = is_inline_string<Type>

Trait to query if a type is an inline_string.

Template Parameters
TypeThe type to check.

Inherits from std::true_type if Type is an instantiation of inline_string, else std::false_type.

◆ is_integral_constant_like

Backport for the C++26 exposition-only integral-constant-like concept.

Template Parameters
TThe type to test

The concept integral-constant-like<T> specifies that all of the following are true:

  • is_integral_v<remove_cvref_t<decltype(T::value)>>
  • !is_same_v<bool, remove_cvref_t<decltype(T::value)>>
  • convertible_to<T, decltype(T::value)>
  • equality_comparable_with<T, decltype(T::value)>
  • bool_constant<T() == T::value>::value
  • bool_constant<static_cast<decltype(T::value)>(T()) == T::value>::value

◆ is_nothrow_implicitly_constructible

template<class T, class... Args>
using arene::base::is_nothrow_implicitly_constructible
Initial value:
is_implicitly_constructible_detail::
is_nothrow_implicitly_constructible_impl<is_implicitly_constructible_v<T, Args...>, T, Args...>
constexpr bool is_implicitly_constructible_v
Type trait to detect if a type is implicitly constructible from arguments of the specified types.

Type trait to detect if a type is nothrow implicitly constructible from arguments of the specified types.

Template Parameters
TThe type to check if it can be nothrow implicitly constructed.
ArgsThe arguments to try to nothrow implicitly construct with.

◆ is_transparent_comparator_for

template<typename C, typename T, typename U = T>
using arene::base::is_transparent_comparator_for = std::integral_constant<bool, is_transparent_comparator_for_v<C, T, U>>

◆ is_transparent_three_way_comparator_for

template<typename C, typename T, typename U = T>
using arene::base::is_transparent_three_way_comparator_for
Initial value:
A helper class to represent a compile-time constant with the specified type and value....
Definition integral_constant.hpp:23

Trait to determine if a given type is a transparent comparator for a given set of operands.

Template Parameters
CThe type to test
TThe type of the left hand operand
UThe type of the right hand operand Value will be equivalent to is_transparent_three_way_comparator_v<C> && is_invocable_r_v<strong_ordering, C, T, U>.

◆ kind_with_exponent_t

template<typename Kind, units_detail::exponent_t Exponent>
using arene::base::kind_with_exponent_t
Initial value:
typename units_detail::kind_with_exponent_helper<
(Exponent < 0) ? 0 : Exponent,
(Exponent < 0) ? -Exponent : 0>::type
typename remove_cv< T >::type remove_cv_t
An alias for T, but with top-level const and/or volatile qualifiers removed.
Definition remove_cv.hpp:64

Alias template for raising the specified quantity kind to the specified exponent.

Template Parameters
KindThe quantity kind to raise to an exponent
ExponentThe exponent to raise it to

◆ lock_guard

template<typename Mutex>
using arene::base::lock_guard = mutex_detail::selected_lock_guard<Mutex>

A lock guard suitable for use with clang's Thread Safety Analysis. Equivalent to std::lock_guard.

If Thread Safety Analysis is not supported by the current compiler, or the current stdlib already has a TSA annotated std::lock_guard, then this is a simple alias to std::lock_guard. Otherwise it is a thin wrapper around std::lock_guard which annotates it as a scoped capability, but is otherwise identical to std::lock_guard.

Note
The support for Thread Safety Analysis is detected by the ARENE_HAS_THREAD_SAFETY_ANALYSIS platform query.
Currently, only libcxx has an out of the box annotated implementation. Detection is done via the ARENE_STDLIB_LIBCXX platform query.
Template Parameters
Mutexthe type of the mutex to guard.

◆ make_index_sequence_between

A helper alias template for make_integer_sequence_between<size_t, Begin, End>

Template Parameters
Beginthe starting value of the sequence
Endthe ending value of the sequence (not included)
Precondition
Requires that End >= Begin

◆ make_index_sequence_from

A helper alias template for make_integer_sequence_from<size_t, Begin, Size>

Template Parameters
Beginthe starting value of the sequence
Sizethe size of the sequence
Precondition
Requires that the sequence does not overflow the maximum value representable by size_t

◆ make_index_sequence_repeat_n

Initial value:
Count,
make_index_sequence_repeat_n_detail::to_index_sequence,
typename repeat_type< N, T, Arg >::type repeat_type_t
Repeat a template argument a specified number of times.
Definition repeat_type.hpp:48

An std::index_sequence whose elements are Count copies of Value.

Template Parameters
Valuethe value to repeat
Countthe number of copies to emit

◆ make_integer_sequence_between

template<typename Type, Type Begin, Type End>
using arene::base::make_integer_sequence_between = typename make_integer_sequence_detail::make_between_impl<Type, Begin, End>::type

Create an integer_sequence between two values [Begin, End)

Template Parameters
Typethe integer type
Beginthe starting value of the sequence
Endthe ending value of the sequence (not included)
Precondition
Requires that End >= Begin

◆ make_integer_sequence_from

template<typename Type, Type Begin, Type Size>
using arene::base::make_integer_sequence_from = typename make_integer_sequence_detail::make_from_impl<Type, Begin, Size>::type

Create an integer_sequence starting from a particular value.

Template Parameters
Typethe integer type
Beginthe starting value of the sequence
Sizethe size of the sequence
Precondition
Requires that the sequence does not overflow the maximum value representable by Type
Requires Size >= 0

◆ max_align_t

A POD type with the maximum alignment constraint.

◆ member_function_arguments_t

template<class F>
using arene::base::member_function_arguments_t = function_arguments_t<typename member_pointer_traits<F>::pointee_type>

Obtains the argument types of a member function pointer type.

Template Parameters
Fmember function pointer type

◆ member_function_return_t

template<class F>
using arene::base::member_function_return_t = function_return_t<typename member_pointer_traits<F>::pointee_type>

Obtains the return type of a member function pointer type.

Template Parameters
Fmember function pointer type

◆ member_pointer_class_type

template<typename PointerToMember>
using arene::base::member_pointer_class_type
Initial value:
typename member_pointer_class_type_detail::member_pointer_class_type_impl<PointerToMember>::type

A type alias to the class type for which the supplied parameter is a pointer-to-member of.

Template Parameters
PointerToMemberThe type of the pointer-to-member for which to obtain the class of which it is a pointer to member of

◆ member_pointer_traits

template<class F>
using arene::base::member_pointer_traits = typename function_traits_detail::member_pointer_traits_impl<std::remove_cv_t<F>>

Contains the class_type and pointee_type of the given member pointer.

Template Parameters
Fmember pointer type

◆ monostate_identity

template<class T>
using arene::base::monostate_identity
Initial value:
typename static_if<std::is_void<T>::value>::template then_apply_else<give_cv_to_t, T, T, monostate>

A metafunction that is an identity for all types except for void types.

In the case of a void type, this results in arene::base::monostate with the same cv-qualifiers.

Template Parameters
TThe parameter type.

◆ mutex

using arene::base::mutex = mutex_detail::selected_mutex

A mutex suitable for use with clang's Thread Safety Analysis. Equivalent to std::mutex.

If Thread Safety Analysis is not supported by the current compiler, or the current stdlib already has a TSA annotated std::mutex, then this is a simple alias to std::mutex. Otherwise it is a thin wrapper around std::mutex which annotates it as a capability, but is otherwise identical to std::mutex.

Note
The support for Thread Safety Analysis is detected by the ARENE_HAS_THREAD_SAFETY_ANALYSIS platform query.
Currently, only libcxx has an out of the box annotated implementation. Detection is done via the ARENE_STDLIB_LIBCXX platform query.

◆ noexcept_function_ref

template<typename Signature>
using arene::base::noexcept_function_ref = function_ref<Signature, true>

A convience alias for function_ref with IsNoexcept set true.

Template Parameters
SignatureThe function signature being wrapped of the form Return-type (Args...) optional-const

◆ noexcept_inline_function

template<typename Signature, std::size_t BufferSize = default_inline_function_size>
using arene::base::noexcept_inline_function = inline_function<Signature, BufferSize, true>

A function wrapper to a noexcept-qualified invocable akin to std::function that always stores the wrapped invocable internally.

Template Parameters
SignatureThe signature of the function call operator.
BufferSizeThe size of the internal buffer. It defaults to 4 times the size of a pointer.
Note
If the signature is const-qualified (e.g. int (int,double) const ) then the function call operator for this class will also be const-qualified. If the signature is not const-qualified, then only non-const objects will be invocable.

◆ non_null_ptr

template<typename T>
using arene::base::non_null_ptr = non_null<T*>

Alias for a non_null which holds a raw pointer.

Template Parameters
TThe type of the pointed to element

◆ null_opt_t

alias to maintain backwards compatibility with older versions of Arene Base.

See also
arene::base::nullopt_t
Deprecated

◆ nullptr_t

using arene::base::nullptr_t = ::std::nullptr_t

The type of nullptr.

◆ ptrdiff_t

The type of the difference between two pointers.

◆ quantity_kind

template<typename Derived, typename ParentKindOrOriginOrUnit = units_detail::missing, typename OriginOrUnit = units_detail::missing, typename Unit = units_detail::missing>
using arene::base::quantity_kind
Initial value:
typename quantity_kind_detail::choose_quantity_kind_base<
Derived,

ParentKind class for declaring a quantity kind with a parent quantity kind.

Template Parameters
Derivedthe derived class which represents the quantity kind
ParentKindOrOriginOrUnitoptional; the type of the parent quantity kind for Derived, or the type of the quantity origin, or the type of the default unit
OriginOrUnitoptional; the type of the quantity origin, or the default unit. Must not be specified if ParentKindOrOriginOrUnit is a unit, and must not be an origin if ParentKindOrOriginOrUnit is an origin
Unitthe type of the default unit. Must not be specified if either of ParentKindOrOriginOrUnit or OriginOrUnit is a unit
Precondition
Derived must derive from quantity_kind<Derived, ParentKindOrUnit, Unit>

◆ quantity_origin_t

template<typename Kind>
using arene::base::quantity_origin_t = typename Kind::origin

Type trait to get the origin of a quantity; if none exists, then this will cause a compilation error.

Template Parameters
KindQuantity kind to check

◆ remove_cv_t

template<typename T>
using arene::base::remove_cv_t = typename std::remove_cv<T>::type

Backport of std::remove_cv_t.

Template Parameters
TThe source type

◆ remove_cvref_t

Backport of std::remove_cvref_t.

Template Parameters
TThe source type

◆ remove_reference_t

template<typename T>
using arene::base::remove_reference_t = typename std::remove_reference<T>::type

Backport of std::remove_reference_t.

Template Parameters
TThe source type

◆ repeat_type_t

template<std::size_t N, template< typename... > class T, typename Arg>
using arene::base::repeat_type_t = typename repeat_type<N, T, Arg>::type

Repeat a template argument a specified number of times.

Template Parameters
NThe number of times to repeat.
TThe templated type.
ArgThe repeated argument.

◆ scaled_unit

template<typename BaseUnit, typename Scale>
using arene::base::scaled_unit = typename scaled_unit_detail::scaled_unit_helper<BaseUnit, Scale>::type

Type alias for a quantity unit that is another unit scaled by some scale factor.

Template Parameters
BaseUnitthe underlying unit
Scalethe scale factor

◆ selected_unit_for_t

template<typename Kind>
using arene::base::selected_unit_for_t = typename selected_unit_for_detail::selected_unit_for_impl<std::remove_cv_t<Kind>>::type

Type trait for determining the unit for a quantity kind. If there is a unit for a given kind, then it is a type alias for the unit type. Otherwise, it is undefined.

Template Parameters
Kindthe type to check

◆ size_t

The type of the size of an object.

◆ smallest_signed_integer_for

template<std::int64_t MinValue, std::int64_t MaxValue, constraints< std::enable_if_t<(MaxValue >=MinValue)>>
using arene::base::smallest_signed_integer_for
Initial value:
(MaxValue <= smallest_integer_for_detail::max_int8) && (MinValue >= smallest_integer_for_detail::min_int8),
(MaxValue <= smallest_integer_for_detail::max_int16) && (MinValue >= smallest_integer_for_detail::min_int16),
(MaxValue <= smallest_integer_for_detail::max_int32) &&
(MinValue >= smallest_integer_for_detail::min_int32),
typename static_if< B >::template then_else< T, F > conditional_t
lazily select between two types based on a boolean condition
Definition conditional.hpp:28
::int32_t int32_t
A 32-bit signed integer type.
Definition cstdint.hpp:66
::int16_t int16_t
A 16-bit signed integer type.
Definition cstdint.hpp:61
::int8_t int8_t
An 8-bit signed integer type.
Definition cstdint.hpp:55
::int64_t int64_t
A 64-bit signed integer type.
Definition cstdint.hpp:71

Calculates the smallest unsigned integer type that can be used to hold values from MinValue up to and including MaxValue.

Template Parameters
MinValueThe minimum value to store
MaxValueThe maximum value to store, must be greater than or equal to MinValue

◆ smallest_unsigned_integer_for

Initial value:
(MaxValue <= smallest_integer_for_detail::max_uint8),
(MaxValue <= smallest_integer_for_detail::max_uint16),
conditional_t<(MaxValue <= smallest_integer_for_detail::max_uint32), std::uint32_t, std::uint64_t>>>
::uint8_t uint8_t
An 8-bit unsigned integer type.
Definition cstdint.hpp:30
::uint16_t uint16_t
A 16-bit unsigned integer type.
Definition cstdint.hpp:36

Calculates the smallest unsigned integer type that can be used to hold values up to and including MaxValue.

Template Parameters
MaxValueThe maximum value to store

◆ strong_ordering

using arene::base::strong_ordering = strong_ordering_detail::strong_ordering

The enumeration specifying the result of an ordering comparison.

◆ submdspan_subextents_type_t

template<class Extents, class... SliceSpecifiers>
using arene::base::submdspan_subextents_type_t = typename submdspan_subextents_type<Extents, SliceSpecifiers...>::type

determines the subextents type from an extents type and slice specifiers

Template Parameters
Extentsspecialization of extents type
SliceSpecifiersparameter pack specifying the subset of each rank in Extents

◆ timed_mutex

using arene::base::timed_mutex = mutex_detail::selected_timed_mutex

A timed mutex suitable for use with clang's Thread Safety Analysis. Equivalent to std::timed_mutex.

If Thread Safety Analysis is not supported by the current compiler, or the current stdlib already has a TSA annotated std::timed_mutex, then this is a simple alias to std::timed_mutex. Otherwise it is a thin wrapper around std::timed_mutex which annotates it as a capability, but is otherwise identical to std::timed_mutex.

Note
The support for Thread Safety Analysis is detected by the ARENE_HAS_THREAD_SAFETY_ANALYSIS platform query.
Currently, only libcxx has an out of the box annotated implementation. Detection is done via the ARENE_STDLIB_LIBCXX platform query.

◆ type_identity_t

template<typename T>
using arene::base::type_identity_t = typename type_identity<T>::type

Polyfill of std::type_identity_t added in C++20.

Template Parameters
TThe type to preserve
See also
arene::base::type_identity

◆ uint16_t

A 16-bit unsigned integer type.

◆ uint32_t

A 32-bit unsigned integer type.

◆ uint64_t

A 64-bit unsigned integer type.

◆ uint8_t

An 8-bit unsigned integer type.

◆ uintptr_t

An integer type big enough to hold a pointer.

◆ unit_kind_t

template<typename Unit>
using arene::base::unit_kind_t = typename unit_kind_detail::unit_kind_helper<Unit>::type

Alias template for the underlying quantity kind for a unit.

Template Parameters
UnitThe unit to get the quantity kind for

◆ unwrap_ref_decay_t

Backport of std::unwrap_ref_decay_t from C++20.

Template Parameters
TA type to decay and then unwrap a reference wrapper

◆ unwrap_reference_t

template<class T>
using arene::base::unwrap_reference_t
Initial value:
unwrap_reference_detail::reference_type_t,
T>
constexpr bool is_instantiation_of_v
Definition is_instantiation_of.hpp:16

Backport of std::unwrap_reference_t from C++20.

Template Parameters
TA type from which to remove a std::reference_wrapper

◆ variant_alternative_t

template<std::size_t I, class T>
using arene::base::variant_alternative_t = typename variant_alternative<I, T>::type

Helper type of variant_size variant_alternative.

Template Parameters
Ithe index of the type
Tthe variant type

◆ void_t

template<class...>
using arene::base::void_t = void

An alias for void that accepts any number of type parameters, used for substitution checks.

a backport of C++17's std::void_t

Enumeration Type Documentation

◆ cv_qualifier

Denotes the cv-qualification Specficially for member function pointers.

Enumerator
unqualified 
const_qualified 
volatile_qualified 
const_volatile_qualified 

◆ inequality_heuristic

enum class arene::base::inequality_heuristic : bool
strong

An enumeration used for the return value of fast_inequality_check functions to indicate if two values are definitely not equal, or may be equal or not. This is used in generic implementations of operator== and operator!= to avoid comparing for ordering when only equality is required.

Enumerator
definitely_not_equal 

The two values checked are definitely not equal to each other.

may_be_equal_or_not_equal 

The values checked may or may not be equal to each other; a more detailed check is required.

◆ reference_qualifier

Denotes the reference-qualification Specficially for member function pointers.

Enumerator
unqualified 
lvalue_qualified 
rvalue_qualified 

◆ sem_ver_diff

The set of differences between two semantic_version s, encoded as a bitfield of [patch.minor.major].

See also
compute_difference to create a sem_ver_diff from two semantic_version instances.
Enumerator
none 

No changes. 0b000.

major 

A major change. 0b001.

minor 

A minor change. 0b010.

patch 

A patch change. 0b100.

major_minor 

A change to both the major and minor versions.

major_patch 

A change to both the major and patch versions.

minor_patch 

A change to both the minor and patch versions.

major_minor_patch 

A change to major, minor, and patch versions.

Function Documentation

◆ abs()

template<typename Number, constraints< std::enable_if_t< std::is_integral< Number >::value >, std::enable_if_t< std::is_signed< Number >::value > > = nullptr>
auto arene::base::abs ( Number value) -> Number
constexprnoexcept

Calculate the absolute value of a number.

Template Parameters
NumberThe type of the number.
Parameters
valueThe value to take the absolute value of.
Precondition
If Number is an Integral type, value is not the smallest negative number the type can represent.
Returns
The absolute value of value, which is equivalent to return value < 0 ? -value : value;.
Template Parameters
NumberThe type of the number.
Parameters
valueThe value to take the absolute value of.
Precondition
value is not the smallest negative number the type can represent.
Returns
The absolute value of value, which is equivalent to return value < 0 ? -value : value;.
Note
Care should be taken when calling abs with unsigned values. This overload for unsigned values does not prevent potential logic errors in expressions like: arene::base::abs(a - b), where unsigned wraparound can lead to unexpected behavior if a < b. Ensure that you understand the implications of using abs() with unsigned types and consider using arene::base::abs_diff(a, b) instead.
Template Parameters
NumberThe type of the number.
Parameters
valueThe value to take the absolute value of.
Returns
The absolute value of value, which is equivalent to return value < 0 ? -value : value;.

◆ abs_diff()

template<typename Number, constraints< std::enable_if_t< std::is_arithmetic< Number >::value > > = nullptr>
auto arene::base::abs_diff ( Number first,
Number second ) -> Number
constexprnoexcept

Calculate the absolute difference between two numbers.

Template Parameters
NumberThe type of the number.
Parameters
firstThe first value to take the absolute difference of
secondThe second value to take the absolute difference of
Returns
The absolute difference between first and second

◆ align_ceil()

template<std::size_t Alignment, typename Integer, constraints< std::enable_if_t< std::is_integral< Integer >::value > > = nullptr>
auto arene::base::align_ceil ( Integer value) -> Integer
constexpr

Align a value to the nearest multiple of alignment, rounding up.

Template Parameters
AlignmentThe alignment to align to. Must be a positive power-of-two.
IntegerThe type of integer to align.
Parameters
valueThe value to align.
Returns
Either value if it was already a multiple of alignment , otherwise the closest multiple of alignment greather than value .

◆ align_floor()

template<std::size_t Alignment, typename Integer, constraints< std::enable_if_t< std::is_integral< Integer >::value > > = nullptr>
auto arene::base::align_floor ( Integer value) -> Integer
constexpr

Align a value to the nearest multiple of alignment, rounding down.

Template Parameters
AlignmentThe alignment to align to. Must be a positive power-of-two.
IntegerThe type of the integer to align.
Parameters
valueThe value to align.
Returns
Either value if it was already a multiple of alignment , otherwise the closest multiple of alignment less than value.

◆ alignment_offset()

template<std::size_t Alignment>
auto arene::base::alignment_offset ( alignment_detail::pointer_to_anything const ptr) -> std::size_t
noexcept

Calculate the amount by which ptr needs to be adjusted to have the specified Alignment.

Template Parameters
AlignmentThe alignment to calculate the offset to.
Parameters
ptrThe address to calculate the offset for.
Returns
The number of bytes that must be added to ptr address to obtain an address that is a multiple of Alignment.

◆ ARENE_CPP14_INLINE_VARIABLE() [1/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( advance_detail::advance ,
advance  )

◆ ARENE_CPP14_INLINE_VARIABLE() [2/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( algorithm_detail::inner_product_detail::inner_product_fn ,
inner_product  )

◆ ARENE_CPP14_INLINE_VARIABLE() [3/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( algorithm_detail::inplace_merge_detail::inplace_merge_impl_fn ,
inplace_merge  )

◆ ARENE_CPP14_INLINE_VARIABLE() [4/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( algorithm_detail::iter_swap_detail::iter_swap_impl_fn ,
iter_swap  )

◆ ARENE_CPP14_INLINE_VARIABLE() [5/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( algorithm_detail::rotate_detail::rotate_impl_fn ,
rotate  )

◆ ARENE_CPP14_INLINE_VARIABLE() [6/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( algorithm_detail::sort_detail::sort_impl_fn ,
sort  )

◆ ARENE_CPP14_INLINE_VARIABLE() [7/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( algorithm_detail::stable_sort_detail::stable_sort_impl_fn ,
stable_sort  )

◆ ARENE_CPP14_INLINE_VARIABLE() [8/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( algorithm_detail::transform_reduce_detail::transform_reduce_fn ,
transform_reduce  )

◆ ARENE_CPP14_INLINE_VARIABLE() [9/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( all_of_detail::all_of_fn ,
all_of  )

◆ ARENE_CPP14_INLINE_VARIABLE() [10/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( any_of_detail::any_of_fn ,
any_of  )

◆ ARENE_CPP14_INLINE_VARIABLE() [11/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( apply_detail::do_apply ,
apply  )

◆ ARENE_CPP14_INLINE_VARIABLE() [12/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( bind_back_detail::bind_back_fn ,
bind_back  )

◆ ARENE_CPP14_INLINE_VARIABLE() [13/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( bind_front_detail::bind_front_fn ,
bind_front  )

◆ ARENE_CPP14_INLINE_VARIABLE() [14/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( construct_at_detail::do_construct_at ,
construct_at  )

◆ ARENE_CPP14_INLINE_VARIABLE() [15/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( destroy_at_detail::do_destroy_at ,
destroy_at  )

◆ ARENE_CPP14_INLINE_VARIABLE() [16/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( equal_detail::equal_fn ,
equal  )

◆ ARENE_CPP14_INLINE_VARIABLE() [17/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( extents_detail::make_extents_fn ,
make_extents  )

◆ ARENE_CPP14_INLINE_VARIABLE() [18/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( full_extent_t ,
full_extent  )

◆ ARENE_CPP14_INLINE_VARIABLE() [19/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( inline_string_detail::make_inline_string_impl_fn ,
make_inline_string  )

◆ ARENE_CPP14_INLINE_VARIABLE() [20/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( iota_detail::iota_fn ,
iota  )

◆ ARENE_CPP14_INLINE_VARIABLE() [21/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( lexicographical_compare_detail::lexicographical_compare_fn ,
lexicographical_compare  )

◆ ARENE_CPP14_INLINE_VARIABLE() [22/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( lexicographical_compare_detail::lexicographical_compare_three_way_fn ,
lexicographical_compare_three_way  )

◆ ARENE_CPP14_INLINE_VARIABLE() [23/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( make_mdspan_detail::make_mdspan_impl ,
make_mdspan  )

◆ ARENE_CPP14_INLINE_VARIABLE() [24/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( not_fn_detail::not_fn_impl ,
not_fn  )

◆ ARENE_CPP14_INLINE_VARIABLE() [25/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( safe_comparisons_detail::cmp_equal_fn ,
cmp_equal  )

◆ ARENE_CPP14_INLINE_VARIABLE() [26/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( safe_comparisons_detail::cmp_greater_equal_fn ,
cmp_greater_equal  )

◆ ARENE_CPP14_INLINE_VARIABLE() [27/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( safe_comparisons_detail::cmp_greater_fn ,
cmp_greater  )

◆ ARENE_CPP14_INLINE_VARIABLE() [28/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( safe_comparisons_detail::cmp_less_equal_fn ,
cmp_less_equal  )

◆ ARENE_CPP14_INLINE_VARIABLE() [29/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( safe_comparisons_detail::cmp_less_fn ,
cmp_less  )

◆ ARENE_CPP14_INLINE_VARIABLE() [30/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( safe_comparisons_detail::cmp_not_equal_fn ,
cmp_not_equal  )

◆ ARENE_CPP14_INLINE_VARIABLE() [31/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( submdspan_canonicalize_slices_detail::submdspan_canonicalize_slices_fn ,
submdspan_canonicalize_slices  )

◆ ARENE_CPP14_INLINE_VARIABLE() [32/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( submdspan_detail::submdspan_fn ,
submdspan  )

◆ ARENE_CPP14_INLINE_VARIABLE() [33/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( submdspan_extents_detail::submdspan_extents_fn ,
submdspan_extents  )

◆ ARENE_CPP14_INLINE_VARIABLE() [34/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( transform_detail::transform_fn ,
transform  )

◆ ARENE_CPP14_INLINE_VARIABLE() [35/35]

arene::base::ARENE_CPP14_INLINE_VARIABLE ( tuple_cat_detail::tuple_cat_fn ,
tuple_cat  )

◆ ARENE_IGNORE_ALL() [1/3]

arene::base::ARENE_IGNORE_ALL ( "-Wdeprecated-declarations" ,
"We still want to use the deprecated class in this other deprecated class"  )

◆ ARENE_IGNORE_ALL() [2/3]

arene::base::ARENE_IGNORE_ALL ( "-Wfloat-equal" ,
"Checking for existence of comparison,
not using it"  )

◆ ARENE_IGNORE_ALL() [3/3]

arene::base::ARENE_IGNORE_ALL ( "-Wfloat-equal" ,
"Equality is used to check the properties of a single value,
not compare two values"  )

◆ ARENE_IGNORE_END() [1/2]

template<typename Derived, typename Other = Derived>
arene::base::ARENE_IGNORE_END ( )

Helper class that can be inherited from by a class to define the <, >, <=, >=, ==, and != comparison operators in terms of a three_way_compare function provided by the Derived class.

Requires that the derived class provides a static member function three_way_compare that accepts two const Derived& and returns a strong_ordering value indicating whether the first is less than, equal to or greater than the second. This three_way_compare functions must not throw exceptions.

Template Parameters
DerivedThe type of the derived class. The comparison operators provided take parameters of this type.

For example:

class MyClass :
arene::base::full_ordering_operators_from_three_way_compare<MyClass> {
...
friend arene::base::string_ordering three_way_compare(
const MyClass& a, const MyClass& b) noexcept;
};
Deprecated
Prefer arene::base::generic_ordering_from_three_way_compare

◆ ARENE_IGNORE_END() [2/2]

arene::base::ARENE_IGNORE_END ( )

◆ ARENE_IGNORE_START() [1/2]

template<typename Derived, typename Other = Derived>
arene::base::ARENE_IGNORE_START ( )

Helper class that can be inherited from by a class to define the <, >, <= and >= comparison operators in terms of a three_way_compare function provided by the Derived class, and define the != operator in terms of the == operator.

Requires that the derived class provides a static member function three_way_compare that accepts a const Derived& and a const Other&, and returns a strong_ordering value indicating whether the first is less than, equal to or greater than the second. This three_way_compare functions must not throw exceptions.

Requires that operator==(const Derived&, const Other&) is defined and does not throw exceptions

Template Parameters
DerivedThe type of the derived class. The comparison operators provided take parameters of this type.
OtherThe type of the other object to compare. The comparison operators provided take parameters of this type.

For example:

class MyClass :
arene::base::full_ordering_operators_from_three_way_compare_and_equals<MyClass> {
...
friend arene::base::string_ordering three_way_compare(
const MyClass& a, const MyClass& b) noexcept;
friend bool operator==(const MyClass& a, const MyClass& b) noexcept;
};
Deprecated
Prefer arene::base::generic_ordering_from_three_way_compare

◆ ARENE_IGNORE_START() [2/2]

arene::base::ARENE_IGNORE_START ( )

◆ as_bytes()

template<typename T, std::size_t N>
auto arene::base::as_bytes ( span< T, N > spn) -> span<byte const, span_detail::is_dynamic_extent(N) ? dynamic_extent : (N * sizeof(T))>
noexcept

Obtain a const view to the object representation of the elements of the span spn.

Parameters
spnThe span of elements to inspect.
Returns
A span<const Byte, Size> of the object representations of the elements of spn.

◆ as_const() [1/2]

template<typename T>
auto arene::base::as_const ( T & obj) -> std::add_const_t<T>&
constexprnoexcept

Obtain an lvalue-reference to a const object of type T.

Use this as an easier way to obtain a const-reference, deducing the appropriate type compared to writing explicit const_cast expressions.

Note
This is a back-port of the std::as_const() function.
Template Parameters
TThe type of the object to add const to
Parameters
objThe object to obtain a const-reference to.
Returns
A const-lvalue-reference to the argument.

◆ as_const() [2/2]

template<typename T>
void arene::base::as_const ( T const && rvalue)
constexprdelete

Prevent passing rvalue arguments to as_const().

Template Parameters
TThe type of the object to add const to
Parameters
rvalueThe rvalue object

◆ as_writable_bytes()

template<typename T, std::size_t N, constraints< std::enable_if_t<!std::is_const< T >::value > > = nullptr>
auto arene::base::as_writable_bytes ( span< T, N > spn) -> span<byte, span_detail::is_dynamic_extent(N) ? dynamic_extent : (N * sizeof(T))>
noexcept

Obtain a non-const view to the object representation of the elements of the span spn.

Parameters
spnThe span of elements to inspect.
Returns
A span<byte, Size> of the object representations of the elements of spn.

◆ bind_overloads()

template<typename... OverloadsT>
auto arene::base::bind_overloads ( OverloadsT &&... overloads) -> bind_overloads_detail::bind_overloads_t<std::decay_t<OverloadsT>...>
constexprnoexcept

Given a sequence of invocables, creates a type which is the sum-type of all the input invocables.

Typically, bind_overloads is used to produce a variant-visitor inline from a sequence of lambdas, like so:

void use_bind_overloads() {
my_variant var{"Hello, Variant!"};
// prints "The value is a string_view: Hello, Variant!\n2\n"
std::cout << arene::base::visit(
[](int value) {
std::cout << "The value is an int: " << value << '\n';
return 0;
},
[](float value) {
std::cout << "The value is a float: " << value << '\n';
return 1;
},
std::cout << "The value is a string_view: " << value << '\n';
return 2;
}
),
var
)
<< '\n';
}
Template Parameters
OverloadsTThe types of the invocables to combine.
Parameters
overloadsThe invocables to combine. They will be perfect-forwarded into the resulting object.
Returns
An implementation-defined type which is the summation of the input callables and can be invoked as if it were any of them.

◆ bit_mask()

template<typename Integer, constraints< std::enable_if_t< std::is_unsigned< Integer >::value > > = nullptr>
auto arene::base::bit_mask ( std::uint32_t const one_bits) -> Integer
constexpr

Construct a bit-mask with the lowest one_bits bits set to 1 and the rest of the bits set to 0.

For example:

assert(arene::base::bit_mask<std::uint32_t>(5) == 0b0000'0000'0001'1111u);
Template Parameters
IntegerThe mask type to return.
Parameters
one_bitsThe number of bits to set to 1 in the mask. Must be in range [0, Integer-bit-width].
Returns
A value of type Integer with the lowest one_bits bits set to 1 and the rest of the bits set to 0.

◆ byte_swap() [1/8]

auto arene::base::byte_swap ( std::int16_t const value) -> std::int16_t
constexprnoexcept

Swap the order of bytes in a given value.

Parameters
valueThe value to byte-swap.
Returns
A value having the representation that has the same bytes as value but with the byte-order reversed.

◆ byte_swap() [2/8]

auto arene::base::byte_swap ( std::int32_t const value) -> std::int32_t
constexprnoexcept

Swap the order of bytes in a given value.

Parameters
valueThe value to byte-swap.
Returns
A value having the representation that has the same bytes as value but with the byte-order reversed.

◆ byte_swap() [3/8]

auto arene::base::byte_swap ( std::int64_t const value) -> std::int64_t
constexprnoexcept

Swap the order of bytes in a given value.

Parameters
valueThe value to byte-swap.
Returns
A value having the representation that has the same bytes as value but with the byte-order reversed.

◆ byte_swap() [4/8]

auto arene::base::byte_swap ( std::int8_t const value) -> std::int8_t
constexprnoexcept

Swap the order of bytes in a given value.

Parameters
valueThe value to byte-swap.
Returns
A value having the representation that has the same bytes as value but with the byte-order reversed.

◆ byte_swap() [5/8]

auto arene::base::byte_swap ( std::uint16_t const value) -> std::uint16_t
constexprnoexcept

Swap the order of bytes in a given value.

Parameters
valueThe value to byte-swap.
Returns
A value having the representation that has the same bytes as value but with the byte-order reversed.

◆ byte_swap() [6/8]

auto arene::base::byte_swap ( std::uint32_t const value) -> std::uint32_t
constexprnoexcept

Swap the order of bytes in a given value.

Parameters
valueThe value to byte-swap.
Returns
A value having the representation that has the same bytes as value but with the byte-order reversed.

◆ byte_swap() [7/8]

auto arene::base::byte_swap ( std::uint64_t const value) -> std::uint64_t
constexprnoexcept

Swap the order of bytes in a given value.

Parameters
valueThe value to byte-swap.
Returns
A value having the representation that has the same bytes as value but with the byte-order reversed.

◆ byte_swap() [8/8]

auto arene::base::byte_swap ( std::uint8_t const value) -> std::uint8_t
constexprnoexcept

Swap the order of bytes in a given value.

Parameters
valueThe value to byte-swap.
Returns
A value having the representation that has the same bytes as value but with the byte-order reversed.

◆ check_ordering()

template<typename T>
auto arene::base::check_ordering ( T const & first,
T const & second ) -> void
noexcept

Check that the first value is ordered strictly before the second.

◆ clamp() [1/2]

template<typename T>
auto arene::base::clamp ( T const & val,
T const & low,
T const & high ) -> T const&
constexprnoexcept

Clamp the supplied value between two bounds using std::less for ordering.

Template Parameters
TThe type of the value and both bounds
Parameters
valThe value to clamp between the two bounds
lowThe lower bound
highThe upper bound
Precondition
low must be less than or equal to high
Returns
A reference to val if it's between the bounds, or to the nearest bound if val is outside the bounds

◆ clamp() [2/2]

template<typename T, class Compare, constraints< std::enable_if_t< is_compare_v< Compare &, T const & > > > = nullptr>
auto arene::base::clamp ( T const & val,
T const & low,
T const & high,
Compare comp ) -> T const&
constexprnoexcept

Clamp the supplied value between two bounds using the supplied comparator for ordering.

Template Parameters
TThe type of the value and both bounds
CompareThe type of a comparator which models a strict weak ordering, similar to std::less
Parameters
valThe value to clamp between the two bounds
lowThe lower bound
highThe upper bound
compThe comparator instance to use
Precondition
low must be less than or equal to high ; that is, comp(high,low) must be false
Returns
A reference to val if it's between the bounds, or to the nearest bound if val is outside the bounds

◆ compute_difference()

ARENE_NODISCARD constexpr auto arene::base::compute_difference ( semantic_version const left,
semantic_version const right ) -> sem_ver_diff
inlineconstexprnoexcept

Computes the set of the potential changes between two different semantic versions.

Parameters
leftThe first version value.
rightThe second version value.
Returns
A sem_ver_diff with the following properties:
  • The major bit will be set if contains_major_change(left, right) == true
  • The minor bit will be set if contains_minor_change(left, right) == true
  • The patch bit will be set if contains_patch_change(left, right) == true

◆ CONDITIONAL_TYPED_TEST_P() [1/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeDeathTest ,
ConstructFromOversizedInitializerList ,
std::is_copy_constructible< TypeParam >::value  )
Test
inline_deque crashes when copy constructed from an initializer list that's too large to fit in the capacity

◆ CONDITIONAL_TYPED_TEST_P() [2/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeDeathTest ,
CopyConstructFromBackwardRange ,
std::is_copy_constructible< TypeParam >::value  )
Test
inline_deque crashes when copy constructed from a random-access range in the wrong order

◆ CONDITIONAL_TYPED_TEST_P() [3/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeDeathTest ,
CopyConstructFromOversizedRange ,
std::is_copy_constructible< TypeParam >::value  )
Test
inline_deque crashes when copy constructed from a range that's too large to fit within the capacity

◆ CONDITIONAL_TYPED_TEST_P() [4/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeDeathTest ,
NonWrappingInsertOneWhenFull ,
!TypeParam::wrapping_allowed &&std::is_move_constructible< typename TypeParam::value_type >::value &&std::is_move_assignable< typename TypeParam::value_type >::value  )
Test
Calling the one-element version of insert when a non-wrapping deque is full terminates the application

◆ CONDITIONAL_TYPED_TEST_P() [5/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeDeathTest ,
PopBackWhenEmpty ,
is_double_ended< TypeParam >  )
Test
when the inline_deque is empty, pop_back terminates the application with a precondition violation

◆ CONDITIONAL_TYPED_TEST_P() [6/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeDeathTest ,
PushFrontMoreThanCapacity ,
is_double_ended< TypeParam >  )
Test
Inserting any element beyond an inline_deque's capacity terminates the application with a precondition violation or wraps, depending on its parameters

◆ CONDITIONAL_TYPED_TEST_P() [7/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
BasicFunctionFromBack ,
TypeParam::capacity >= 2 )
Test
basic inline_deque functionality, inserting elements via push_back observing them with front, verifying that it doesn't remove elements, removing with pop_front, and checking the correct dequeing order (namely, FIFO) is preserved with the operations

◆ CONDITIONAL_TYPED_TEST_P() [8/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
BasicFunctionFromFront ,
is_double_ended< TypeParam > &&TypeParam::capacity >= 2 )
Test
basic inline_deque functionality, inserting elements via push_front observing them with back, verifying that it doesn't remove elements, removing with pop_back, and checking the correct dequeing order (namely, FIFO) is preserved with the operations

◆ CONDITIONAL_TYPED_TEST_P() [9/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
CanConstructAtCompileTime ,
InlineDequeTest< TypeParam >::constexpr_compatible  )
Test
inline_deque can be used at compile-time, asserting properties statically

◆ CONDITIONAL_TYPED_TEST_P() [10/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
CanCopyAssign ,
std::is_copy_assignable< TypeParam >::value  )
Test
inline_deque copy-assignment works as expected

◆ CONDITIONAL_TYPED_TEST_P() [11/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
CanCopyConstruct ,
std::is_copy_constructible< TypeParam >::value  )
Test
inline_deque copy-construction works as expected

◆ CONDITIONAL_TYPED_TEST_P() [12/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
CanCopyTryConstruct ,
std::is_copy_constructible< TypeParam >::value  )
Test
inline_deque copy-construction works as expected when invoked via try_construct

◆ CONDITIONAL_TYPED_TEST_P() [13/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
CanObserveAndModifyFromBack ,
TypeParam::capacity >= 2 )
Test
inline_deque's front can also be used to modify the least-recently inserted element inplace

◆ CONDITIONAL_TYPED_TEST_P() [14/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
CanObserveAndModifyFromFront ,
is_double_ended< TypeParam > &&TypeParam::capacity >= 2 )
Test
inline_deque's back can also be used to modify the least-recently inserted element inplace

◆ CONDITIONAL_TYPED_TEST_P() [15/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
ConstructFromEmptyList ,
std::is_copy_constructible< TypeParam >::value  )
Test
inline_deque can be constructed from an empty initializer list

◆ CONDITIONAL_TYPED_TEST_P() [16/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
ConstructFromInitializerList ,
std::is_copy_constructible< TypeParam >::value  )
Test
inline_deque can be constructed from an initializer list of T

◆ CONDITIONAL_TYPED_TEST_P() [17/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
CopyAssignFromPartiallyFull ,
std::is_copy_assignable< TypeParam >::value  )
Test
Copy assignment works from a partially full input

◆ CONDITIONAL_TYPED_TEST_P() [18/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
CopyAssignIntoPartiallyFull ,
std::is_copy_assignable< TypeParam >::value  )
Test
Copy assignment works into a partially full target

◆ CONDITIONAL_TYPED_TEST_P() [19/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
CopyConstructFromRange ,
std::is_copy_constructible< TypeParam >::value  )
Test
inline_deque can be constructed from a range of T using iterators

◆ CONDITIONAL_TYPED_TEST_P() [20/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
CopyInsertOne ,
!TypeParam::wrapping_allowed &&std::is_copy_constructible< typename TypeParam::value_type >::value &&std::is_copy_assignable< typename TypeParam::value_type >::value  )
Test
The copy-based one-element version of insert inserts a copy of the value at the requested position

◆ CONDITIONAL_TYPED_TEST_P() [21/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
CopyInsertOneAtEnd ,
!TypeParam::wrapping_allowed &&std::is_copy_constructible< typename TypeParam::value_type >::value &&std::is_copy_assignable< typename TypeParam::value_type >::value  )
Test
The copy-based one-element version of insert can insert a value at the end

◆ CONDITIONAL_TYPED_TEST_P() [22/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
EmplaceFrontReturnsReference ,
is_double_ended< TypeParam >  )
Test
Emplacing an element into the front of an inline_deque returns a reference to the emplaced element

◆ CONDITIONAL_TYPED_TEST_P() [23/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
FrontPushedElementIsCorrect ,
is_double_ended< TypeParam >  )
Test
Given a default-constructed inline_deque with plenty of capacity, an element can be inserted via push_front and then inspected

◆ CONDITIONAL_TYPED_TEST_P() [24/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
GoCircularFromFront ,
is_double_ended< TypeParam >  )
Test
inline_deque has circular or ring-buffer behavior, such that when previously inserted elements via push_front are removed via pop_back, then space in the fixed-capacity storage of the deque is made available for new elements to be inserted

◆ CONDITIONAL_TYPED_TEST_P() [25/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
InsertConstraints ,
!TypeParam::wrapping_allowed  )
Test
The constraints and exception specifications for the insert functions are correct

◆ CONDITIONAL_TYPED_TEST_P() [26/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
IteratorsNotInvalidatedByPopBack ,
is_double_ended< TypeParam > &&TypeParam::capacity() >= 3U )
Test
Using pop_back() only invalidates iterators and references to the last element and end()

◆ CONDITIONAL_TYPED_TEST_P() [27/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
IteratorsNotInvalidatedByPopFront ,
TypeParam::capacity() >= 2U )
Test
Using pop_front() only invalidates iterators and references to the first element

◆ CONDITIONAL_TYPED_TEST_P() [28/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
MoveInsertOne ,
!TypeParam::wrapping_allowed &&std::is_move_constructible< typename TypeParam::value_type >::value &&std::is_move_assignable< typename TypeParam::value_type >::value  )
Test
The move-based one-element version of insert inserts the value at the requested position

◆ CONDITIONAL_TYPED_TEST_P() [29/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
MoveInsertOneAtEnd ,
!TypeParam::wrapping_allowed &&std::is_move_constructible< typename TypeParam::value_type >::value &&std::is_move_assignable< typename TypeParam::value_type >::value  )
Test
The move-based one-element version of insert can insert a value at the end

◆ CONDITIONAL_TYPED_TEST_P() [30/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
PushBackCopiesLvalues ,
std::is_copy_constructible< TypeParam >::value  )
Test
Pushing lvalue data onto the back of an inline_deque copies it

◆ CONDITIONAL_TYPED_TEST_P() [31/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
PushFrontCopiesLvalues ,
is_double_ended< TypeParam > &&std::is_copy_constructible< TypeParam >::value  )
Test
Pushing lvalue data onto the front of an inline_deque copies it

◆ CONDITIONAL_TYPED_TEST_P() [32/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
PushFrontDetailCoverage ,
!is_double_ended< TypeParam >  )
Test
For deques with a single-ended public interface, the unexposed functions in the other direction still work. This test is needed for coverage purposes.

◆ CONDITIONAL_TYPED_TEST_P() [33/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
PushFrontOneElement ,
is_double_ended< TypeParam >  )
Test
Given a default-constructed inline_deque with plenty of capacity, an element can be inserted via push_front, which causes a size increase

◆ CONDITIONAL_TYPED_TEST_P() [34/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
PushFrontWithinCapacity ,
is_double_ended< TypeParam >  )
Test
Given a default-constructed inline_deque, elements can be inserted via push_front within its capacity, making the size be equal to capacity

◆ CONDITIONAL_TYPED_TEST_P() [35/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
SelfCopyAssign ,
std::is_copy_assignable< TypeParam >::value  )
Test
inline_deque self copy-assignment does nothing

◆ CONDITIONAL_TYPED_TEST_P() [36/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
TryConstructFromOversizedInitializerList ,
std::is_copy_constructible< TypeParam >::value  )
Test
try_construct returns empty when constructing from an initializer list that's too large for the capacity

◆ CONDITIONAL_TYPED_TEST_P() [37/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
TryCopyConstructFromBackwardRange ,
std::is_copy_constructible< TypeParam >::value  )
Test
try_construct returns empty when copy constructing from a random-access range in the wrong order

◆ CONDITIONAL_TYPED_TEST_P() [38/38]

arene::base::CONDITIONAL_TYPED_TEST_P ( InlineDequeTest ,
TryCopyConstructFromOversizedRange ,
std::is_copy_constructible< TypeParam >::value  )
Test
try_construct returns empty when copy constructing from a range that's too large to fit within the capacity

◆ consume_values()

void arene::base::consume_values ( std::initializer_list< consume_values_detail::anything > const & )
inlineconstexprnoexcept

Consume a list of values and discard them. Must be called with an extra pair of braces around the expressions to be consumed: consume_values({e1,e2,...}). The use of std::initializer_list ensures the expressions to be consumed are evaluated in left-to-right sequential order.

Precondition
The supplied expressions must have a non-void type. void_ can be used as the return type if it would otherwise be void

◆ contains_major_change() [1/2]

ARENE_NODISCARD constexpr auto arene::base::contains_major_change ( sem_ver_diff const diff) -> bool
inlineconstexprnoexcept

Predicate to test if a sem_ver_diff contains a major change.

Parameters
diffThe computed difference between two versions
Returns
true if the major bit is set.
false otherwise.

◆ contains_major_change() [2/2]

ARENE_NODISCARD constexpr auto arene::base::contains_major_change ( semantic_version const left,
semantic_version const right ) -> bool
inlineconstexprnoexcept

Compares ONLY the major part of two semantic versions, to see if there's a major change between the two.

Parameters
leftThe first version value.
rightThe second version value.
Returns
true if there is a major change, otherwise false

◆ contains_minor_change() [1/2]

ARENE_NODISCARD constexpr auto arene::base::contains_minor_change ( sem_ver_diff const diff) -> bool
inlineconstexprnoexcept

Predicate to test if a sem_ver_diff contains a minor change.

Parameters
diffThe computed difference between two versions
Returns
true if the minor bit is set.
false otherwise.

◆ contains_minor_change() [2/2]

ARENE_NODISCARD constexpr auto arene::base::contains_minor_change ( semantic_version const left,
semantic_version const right ) -> bool
inlineconstexprnoexcept

Compares ONLY the minor part of two semantic versions, to see if there's a minor change between the two.

Parameters
leftThe first version value.
rightThe second version value.
Returns
true if there is a minor change, otherwise false

◆ contains_patch_change() [1/2]

ARENE_NODISCARD constexpr auto arene::base::contains_patch_change ( sem_ver_diff const diff) -> bool
inlineconstexprnoexcept

Predicate to test if a sem_ver_diff contains a patch change.

Parameters
diffThe computed difference between two versions
Returns
true if the patch bit is set.
false otherwise.

◆ contains_patch_change() [2/2]

ARENE_NODISCARD constexpr auto arene::base::contains_patch_change ( semantic_version const left,
semantic_version const right ) -> bool
inlineconstexprnoexcept

Compares ONLY the patch part of two semantic versions, to see if there's a patch change between the two.

Parameters
leftThe first version value.
rightThe second version value.
Returns
true if there is a patch change, otherwise false

◆ copy()

template<class InputIterator, class OutputIterator, constraints< std::enable_if_t< base::is_input_iterator_v< InputIterator > >, std::enable_if_t< base::is_output_iterator_v< OutputIterator > > > = nullptr>
auto arene::base::copy ( InputIterator first,
InputIterator last,
OutputIterator output ) -> OutputIterator
constexprnoexcept

Copies the elements in the range, defined by [first, last), to another range beginning at output.

Template Parameters
InputIteratorThe type of the Source iterator
OutputIteratorThe type of the Destination iterator
Parameters
firstStart of the range of elements to copy from
lastEnd (non-inclusive) of the range of elements to copy from
outputStart of the range of elements to copy into
Returns
OutputIterator An iterator after the last copied item

◆ copy_if()

template<class InputIterator, class OutputIterator, class Predicate, constraints< std::enable_if_t< base::is_input_iterator_v< InputIterator > >, std::enable_if_t< base::is_output_iterator_v< OutputIterator > >, std::enable_if_t< base::is_invocable_r_v< bool, Predicate &, typename std::iterator_traits< InputIterator >::value_type > > > = nullptr>
auto arene::base::copy_if ( InputIterator first,
InputIterator last,
OutputIterator output,
Predicate pred ) -> OutputIterator
constexprnoexcept

Copies the elements in the range, defined by [first, last), to another range beginning at output. Only copies the elements for which the predicate pred returns true. The relative order of the elements that are copied is preserved.

Template Parameters
InputIteratorThe type of the Source iterator
OutputIteratorThe type of the Destination iterator
PredicateFunction to test whether a value might be copied
Parameters
firstStart of the range of elements to copy from
lastEnd (non-inclusive) of the range of elements to copy from
outputStart of the range of elements to copy into
predUnary predicate which returns true for the required elements
Returns
OutputIterator for the last inserted item

◆ copysign() [1/2]

auto arene::base::copysign ( double const magnitude,
double const sign ) -> double
constexprnoexcept

Return a number with the magnitude of the first operand and the sign of the second.

Parameters
magnitudeThe operand to take the magnitude from
signThe operand to take the sign from
Returns
A value with the same absolute value as magnitude and the same sign as sign

◆ copysign() [2/2]

auto arene::base::copysign ( float const magnitude,
float const sign ) -> float
constexprnoexcept

Return a number with the magnitude of the first operand and the sign of the second.

Parameters
magnitudeThe operand to take the magnitude from
signThe operand to take the sign from
Returns
A value with the same absolute value as magnitude and the same sign as sign

◆ distance()

template<typename Iterator>
auto arene::base::distance ( Iterator first,
Iterator last ) -> typename std::iterator_traits<Iterator>::difference_type
constexprnoexcept

Find the number of elements between first and last.

Template Parameters
IteratorThe type of iterator to compute the distance between
Parameters
firstThe iterator to start the distance computation from
lastThe iterator end the distance computation at
Returns
The number of elements needed to go from first to last. For iterators satisfying random_access_iterator, this value can be negative if first is reachable from last.
Precondition
last must be reachable from first, or else the behavior is undefined.

◆ error_result()

template<typename ErrorType>
auto arene::base::error_result ( ErrorType && error) -> error_result_t<std::remove_reference_t<ErrorType>>
constexprnoexcept

Convenience function to construct a result<Value,ErrorType> containing the ErrorType from any reference.

Example Usage:

// Make "result" contain a "Bar" error object, initialized as "Bar(1, 2)"
arene::base::result<Foo, Bar> res = arene::base::error_result(Bar(1, 2));
Template Parameters
ErrorTypethe error_type of the produced result.
Parameters
errorerror to instantiate the result with.
Returns
error_result_t An object which is move-convertible to any result<Value,ErrorType> .

◆ expand_result()

template<class ResultType, class OnValue, class OnError, constraints< std::enable_if_t< is_instantiation_of_v< std::remove_const_t< std::remove_reference_t< ResultType > >, result > >, std::enable_if_t< std::is_same< invoke_result_t< OnValue, >, invoke_result_t< OnError, > >::value > > = nullptr>
auto arene::base::expand_result ( ResultType && self,
OnValue && on_expected,
OnError && on_unexpected ) ->
constexprnoexcept

Visit the contained value or error with two independent functors.

Template Parameters
ResultTypeThe type of the result object to visit.
OnValueThe type of the invocable to invoke if the result holds a value . Must satisfy is_invocable with the result of self.value() , and must have the same return type as OnValue .
OnErrorThe type of the invocable to invoke if the result holds an error. Must satisfy is_invocable with the result of self.error() , and must have the same return type as OnValue .
Parameters
selfThe result object
on_expectedThe invocable to invoke if self holds a value
on_unexpectedThe invocable to invoke if self holds an error
Returns
auto The result of invoking the appropriate invocable

Example Usage:

arene::base::result<int, std::string> const result = function_that_may_fail();
result,
[](int v) {
// what to do when in the value state
do_something_with(v);
},
[](std::string const& e) {
// what to do when in the error state
do_something_with(e);
}
);

◆ fill()

template<typename Itr, typename Sent, typename T, constraints< std::enable_if_t< denotes_range_v< Itr, Sent > >, std::enable_if_t< std::is_assignable<, T const & >::value > > = nullptr>
void arene::base::fill ( Itr first,
Sent last,
T const & value )
constexprnoexcept

Assigns all elements in a sequence to a given value.

Template Parameters
ItrThe type of the iterator for the sequence. Its reference must be std::assignable from T
SentThe type of the sentinel to mark the end of the sequence. It must be inequality comparable with Itr
TThe type of the value to fill the sequence with.
Parameters
firstIterator to the first position in the sequence to fill.
lastSentinel to mark the end of the sequence to fill.
valueThe value to fill the sequence with.
Postcondition
All elements in the sequence [first,last) will have their element assigned to value
Precondition
Repeated incrementing of first must eventually produce an iterator which compares equal to last , else behavior is undefined.

Performs exactly std::distance(first,last) assignments of value . Backport of the constexpr std::fill from C++20 .

◆ find()

template<typename Iterator, typename Value, constraints< std::enable_if_t< base::is_input_iterator_v< Iterator > >, std::enable_if_t< base::is_equality_comparable_v< typename std::iterator_traits< Iterator >::reference, Value const & > > > = nullptr>
auto arene::base::find ( Iterator first,
Iterator last,
Value const & value_to_find ) -> Iterator
constexprnoexcept

Constexpr-compatible implementation of std::find.

Template Parameters
IteratorThe type of the iterators
ValueThe type of the value being searched for
Parameters
firstThe iterator for the start of the range
lastThe iterator for the end of the range
value_to_findThe value to search for
Returns
Iterator The first iterator for which *it==value, or last if there is no such iterator

◆ find_if()

template<typename Iterator, class Predicate, constraints< std::enable_if_t< base::is_input_iterator_v< Iterator > >, std::enable_if_t< base::is_invocable_r_v< bool, Predicate &, typename std::iterator_traits< Iterator >::reference > > > = nullptr>
auto arene::base::find_if ( Iterator first,
Iterator last,
Predicate pred ) -> Iterator
constexprnoexcept

Returns an iterator to the first element in the range [first, last) that satisfies equality criteria: an element for which predicate pred returns true.

Template Parameters
IteratorThe type of the Iterator to conduct the search
ValueValue to find
PredicateCondition predicate to find a value
Parameters
firstStart of the range to find the value
lastEnd (exclusive) of the range to find the value
predUnary predicate which returns true for the elements to find
Returns
Iterator for the first found item

◆ for_each()

template<typename Tuple, typename Op>
void arene::base::for_each ( Tuple && tuple,
Op && operation )
constexpr

Perform an operation on each element of a "tuple-ish" type, which includes std::tuple, std::pair, std::array, or arene::base::array.

Template Parameters
Tupletype implementing the tuple protocol.
OpThe type of operation to perform on each tuple element.
Parameters
tupleThe tuple-ish to iterate over.
operationThe operation to perform on each element.
Note
A type implements the tuple protocol if it
  • provides a specialization of std::tuple_size
  • provides a specialization of std::tuple_element
  • provides a function to get an element by index I, which is specified as: ** std::forward<Tuple>(tuple).get<I>() if valid ** otherwise, get<I>(std::forward<Tuple>(tuple)) if valid, where get is looked up by ADL only Note that the tuple-like concept defines types that satisfy the tuple protocol but are restricted to a list of types defined in the std namespace (std::array, std::pair, std::tuple in C++14). The term tuple-ish is used to define types that satisfy the tuple protocol without the restriction that the type is define in the std namespace – which includes user-defined types.

◆ for_each_index()

template<typename Tuple, typename Op>
void arene::base::for_each_index ( Tuple && tuple,
Op && operation )
constexpr

Perform an operation on each element of a "tuple-ish" type, which includes std::tuple, std::pair, std::array, or arene::base::array.

Template Parameters
Tupletype implementing the tuple protocol.
OpThe type of operation to perform on each tuple element, which accepts the index as the first parameter of type std::size_t or std::integral_constant<std::size_t, N>.
Parameters
tupleThe tuple-ish to iterate over.
operationThe operation to perform on each element, which should accept a std::size_t or std::integral_constant<std::size_t, N> as the first argument for the element's index.
Note
A type implements the tuple protocol if it
  • provides a specialization of std::tuple_size
  • provides a specialization of std::tuple_element
  • provides a function to get an element by index I, which is specified as: ** std::forward<Tuple>(tuple).get<I>() if valid ** otherwise, get<I>(std::forward<Tuple>(tuple)) if valid, where get is looked up by ADL only Note that the tuple-like concept defines types that satisfy the tuple protocol but are restricted to a list of types defined in the std namespace (std::array, std::pair, std::tuple in C++14). The term tuple-ish is used to define types that satisfy the tuple protocol without the restriction that the type is defined in the std namespace – which includes user-defined types.

◆ from_strong_ordering()

auto arene::base::from_strong_ordering ( strong_ordering const ordering) -> int
inlineconstexprnoexcept

Convert a strong_ordering into an integer three-way-comparison result.

Parameters
orderingThe ordering to convert.
Returns
int -1 if ordering is strong_ordering::less, 0 if ordering is strong_ordering::equal, and 1 if ordering is strong_ordering::greater.

◆ gcd()

template<typename Integral, constraints< std::enable_if_t< std::is_integral< Integral >::value > > = nullptr>
auto arene::base::gcd ( Integral lhs,
Integral rhs ) -> Integral
constexprnoexcept

Calculates the Greatest Common Divisor (GCD) of two Integral values.

Template Parameters
IntegralThe type of the values
Parameters
lhsFirst value
rhsSecond value
Returns
Integral value that is GCD of lhs and rhs . If either lhs or rhs is 0 , then the absolute value of the non-zero operand is returned. If both are 0 , then returns 0 .

◆ get() [1/8]

template<std::size_t I, typename T, std::size_t N, constraints< std::enable_if_t<(I< N)> > = nullptr>
auto arene::base::get ( array< T, N > && arr) -> T&&
constexprnoexcept

Get a reference to the element at the specified index in the array.

Template Parameters
IThe index of the element to retrieve. Must satisfy I<N .
TThe type of the array elements
NThe number of array elements
Parameters
arrThe array to retrieve the element from
Returns
T&& equivalent to std::move(arr[I]) .

◆ get() [2/8]

template<std::size_t I, typename T, std::size_t N, constraints< std::enable_if_t<(I< N)> > = nullptr>
auto arene::base::get ( array< T, N > & arr) -> T&
constexprnoexcept

Get a reference to the element at the specified index in the array.

Template Parameters
IThe index of the element to retrieve. Must satisfy I<N .
TThe type of the array elements
NThe number of array elements
Parameters
arrThe array to retrieve the element from
Returns
T& equivalent to arr[I] .

◆ get() [3/8]

template<std::size_t I, typename T, std::size_t N, constraints< std::enable_if_t<(I< N)> > = nullptr>
auto arene::base::get ( array< T, N > const && arr) -> T const&&
constexprnoexcept

Get a reference to the element at the specified index in the array.

Template Parameters
IThe index of the element to retrieve. Must satisfy I<N .
TThe type of the array elements
NThe number of array elements
Parameters
arrThe array to retrieve the element from
Returns
T const&& equivalent to std::move(arr[I]) .

◆ get() [4/8]

template<std::size_t I, typename T, std::size_t N, constraints< std::enable_if_t<(I< N)> > = nullptr>
auto arene::base::get ( array< T, N > const & arr) -> T const&
constexprnoexcept

Get a reference to the element at the specified index in the array.

Template Parameters
IThe index of the element to retrieve. Must satisfy I<N .
TThe type of the array elements
NThe number of array elements
Parameters
arrThe array to retrieve the element from
Returns
T const& equivalent to arr[I] .

◆ get() [5/8]

template<typename T, typename... Ts>
auto arene::base::get ( variant< Ts... > && var) -> T&&
inlineconstexprnoexcept

Get value held by a variant by type.

Get value held by a variant by index.

Template Parameters
Tthe alternative type to get
Parameters
varvariant to get from
Exceptions
bad_variant_accessif ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED) and if the type of the object currently held by the variant does not match the type requested.
Precondition
If ARENE_IS_OFF(ARENE_EXCEPTIONS_ENABLED) the type of the object currently held by the variant must match the type requested else ARENE_PRECONDITION violation.
Returns
The reference to the held object.
Template Parameters
Indexthe index into Ts of the alternative to get
Parameters
varvariant to get from
Exceptions
bad_variant_accessif ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED) and if the type index of the object currently held by the variant does not match the index requested.
Precondition
If ARENE_IS_OFF(ARENE_EXCEPTIONS_ENABLED) the index type of the object currently held by the variant must match the type requested else ARENE_PRECONDITION violation.
Returns
The reference to the held object.

◆ get() [6/8]

template<typename T, typename... Ts>
auto arene::base::get ( variant< Ts... > & var) -> T&
inlineconstexprnoexcept

Get value held by a variant by type.

Get value held by a variant by index.

Template Parameters
Tthe alternative type to get
Parameters
varvariant to get from
Exceptions
bad_variant_accessif ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED) and if the type of the object currently held by the variant does not match the type requested.
Precondition
If ARENE_IS_OFF(ARENE_EXCEPTIONS_ENABLED) the type of the object currently held by the variant must match the type requested else ARENE_PRECONDITION violation.
Returns
The reference to the held object.
Template Parameters
Indexthe index into Ts of the alternative to get
Parameters
varvariant to get from
Exceptions
bad_variant_accessif ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED) and if the type index of the object currently held by the variant does not match the index requested.
Precondition
If ARENE_IS_OFF(ARENE_EXCEPTIONS_ENABLED) the type index of the object currently held by the variant must match the type requested else ARENE_PRECONDITION violation.
Returns
The reference to the held object.

◆ get() [7/8]

template<typename T, typename... Ts>
auto arene::base::get ( variant< Ts... > const && var) -> T const&&
inlineconstexprnoexcept

Get value held by a variant by type.

Get value held by a variant by index.

Template Parameters
Tthe alternative type to get
Parameters
varvariant to get from
Exceptions
bad_variant_accessif ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED) and if the type of the object currently held by the variant does not match the type requested.
Precondition
If ARENE_IS_OFF(ARENE_EXCEPTIONS_ENABLED) the type of the object currently held by the variant must match the type requested else ARENE_PRECONDITION violation.
Returns
The reference to the held object.
Template Parameters
Indexthe index into Ts of the alternative to get
Parameters
varvariant to get from
Exceptions
bad_variant_accessif ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED) and if the type index of the object currently held by the variant does not match the index requested.
Precondition
If ARENE_IS_OFF(ARENE_EXCEPTIONS_ENABLED) the type index of the object currently held by the variant must match the type requested else ARENE_PRECONDITION violation.
Returns
The reference to the held object.

◆ get() [8/8]

template<typename T, typename... Ts>
auto arene::base::get ( variant< Ts... > const & var) -> T const&
inlineconstexprnoexcept

Get value held by a variant by type.

Get value held by a variant by index.

Template Parameters
Tthe alternative type to get
Parameters
varvariant to get from
Exceptions
bad_variant_accessif ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED) and if the type of the object currently held by the variant does not match the type requested.
Precondition
If ARENE_IS_OFF(ARENE_EXCEPTIONS_ENABLED) the type of the object currently held by the variant must match the type requested else ARENE_PRECONDITION violation.
Returns
The reference to the held object.
Template Parameters
Indexthe index into Ts of the alternative to get
Parameters
varvariant to get from
Exceptions
bad_variant_accessif ARENE_IS_ON(ARENE_EXCEPTIONS_ENABLED) and if the type index of the object currently held by the variant does not match the index requested.
Precondition
If ARENE_IS_OFF(ARENE_EXCEPTIONS_ENABLED) the type index of the object currently held by the variant must match the type requested else ARENE_PRECONDITION violation.
Returns
The reference to the held object.

◆ get_if() [1/2]

template<std::size_t I, typename... Ts>
auto arene::base::get_if ( variant< Ts... > * ptr) -> std::add_pointer_t<variant_alternative_t<I, variant<Ts...>>>
inlineconstexprnoexcept

Attempt to get a pointer to the object held by the variant by index.

Attempt to get a pointer to the object held by the variant by type.

Template Parameters
IIndex of the type in Ts to get
Tsthe types that the variant can hold
Parameters
ptrA pointer to the variant to access
Returns
A pointer to the held object if the variant holds a value of the type, else nullptr .
Template Parameters
TType in Ts to get
Tsthe types that the variant can hold
Parameters
ptrA pointer to the variant to access
Returns
A pointer to the held object if the variant holds a value of the type, else nullptr .

◆ get_if() [2/2]

template<std::size_t I, typename... Ts>
auto arene::base::get_if ( variant< Ts... > const * ptr) -> std::add_pointer_t<variant_alternative_t<I, variant<Ts...>> const>
inlineconstexprnoexcept

Attempt to get a pointer to the object held by the variant by index.

Attempt to get a pointer to the object held by the variant by type.

Template Parameters
IIndex of the type in Ts to get
Tsthe types that the variant can hold
Parameters
ptrA pointer to the variant to access
Returns
A pointer to the held object if the variant holds a value of the type, else nullptr .
Template Parameters
TType in Ts to get
Tsthe types that the variant can hold
Parameters
ptrA pointer to the variant to access
Returns
A pointer to the held object if the variant holds a value of the type, else nullptr .

◆ holds_alternative()

template<class T, class... Ts>
auto arene::base::holds_alternative ( variant< Ts... > const & var) -> bool
constexprnoexcept

Check if the variant holds a value of a given alternative type.

Template Parameters
Tthe alternative type to check
Tsthe types that the variant can hold
Parameters
varthe variant to check
Returns
true if and only if the variant holds a value of type T.
false otherwise.
Precondition
Ill-formed if T does not appear exactly once in Ts .

◆ invoke()

template<typename F, typename... Args, constraints< std::enable_if_t< is_invocable_v< F, Args... > > > = nullptr>
auto arene::base::invoke ( F && func,
Args &&... args ) ->
constexprnoexcept

Implementation of std::invoke from C++23: invokes the specified callable with the specified arguments.

Template Parameters
FThe type of the callable to invoke
ArgsThe types of the arguments
Parameters
funcThe callable to invoke
argsThe arguments with which to invoke the callable
Returns
The result of invoking the callable with the specified arguments
Note
Does not participate in overload resolution if the specified F cannot be invoked with the specified Args

◆ is_aligned() [1/2]

template<std::size_t Alignment>
auto arene::base::is_aligned ( alignment_detail::pointer_to_anything const pointer) -> bool
constexpr

Check if an address is a multiple of the specified alignment.

Template Parameters
AlignmentThe power-of-2 alignment to check for.
Parameters
pointerThe pointer to check the address of.
Returns
true if the pointer is aligned to a multiple of Alignment , otherwise false.

◆ is_aligned() [2/2]

template<std::size_t Alignment, typename Integer, constraints< std::enable_if_t< std::is_integral< Integer >::value > > = nullptr>
auto arene::base::is_aligned ( Integer value) -> bool
constexpr

Check if an integer is a multiple of the specified power-of-two alignment.

Template Parameters
AlignmentThe alignment to check against. Must be a positive power-of-two.
IntegerAn integral type.
Parameters
valueThe value to check.
Returns
true if value is a multiple of alignment.

◆ is_major_change() [1/2]

ARENE_NODISCARD constexpr auto arene::base::is_major_change ( sem_ver_diff const diff) -> bool
inlineconstexprnoexcept

Predicate to test if a sem_ver_diff represents a change of at least one major version.

Parameters
diffThe computed difference between two versions.
Returns
true if the major bit is set.
false otherwise.

◆ is_major_change() [2/2]

ARENE_NODISCARD constexpr auto arene::base::is_major_change ( semantic_version const left,
semantic_version const right ) -> bool
inlineconstexprnoexcept

Binary predicate to test if two semantic_versions differ by major versions.

Parameters
leftThe left hand operand.
rightThe right hand operand.
Returns
true if major() is different between left and right .
false otherwise.

◆ is_minor_change() [1/2]

ARENE_NODISCARD constexpr auto arene::base::is_minor_change ( sem_ver_diff const diff) -> bool
inlineconstexprnoexcept

Predicate to test if a sem_ver_diff represents a change of minor versions, ignoring patch versions.

Parameters
diffThe computed difference between two versions.
Returns
true if the minor bit is set, and the major bit is not.
false if the major bit is set, or the minor bit is not.

◆ is_minor_change() [2/2]

ARENE_NODISCARD constexpr auto arene::base::is_minor_change ( semantic_version const left,
semantic_version const right ) -> bool
inlineconstexprnoexcept

Binary predicate to test if two semantic_versions differ by minor versions, ignoring patch versions.

Parameters
leftThe left hand operand.
rightThe right hand operand.
Returns
true if minor() is different between left and right, but major() is equivalent.
false if either major() varies between the operands, or minor() is equal.

◆ is_patch_change() [1/2]

ARENE_NODISCARD constexpr auto arene::base::is_patch_change ( sem_ver_diff const diff) -> bool
inlineconstexprnoexcept

Predicate to test if a sem_ver_diff represents a change of exclusively patch versions.

Parameters
diffThe computed difference between two versions.
Returns
true if exclusively the patch bit is set.
false if either the major or minor bits are set.

◆ is_patch_change() [2/2]

ARENE_NODISCARD constexpr auto arene::base::is_patch_change ( semantic_version const left,
semantic_version const right ) -> bool
inlineconstexprnoexcept

Binary predicate to test if two semantic_versions differ by exclusively patch versions.

Parameters
leftThe left hand operand.
rightThe right hand operand.
Returns
true if the difference between left and right is exclusively in patch() .
false if either major() or minor() vary between the operands, or patch() is equal.

◆ is_possibly_constant_evaluated()

auto arene::base::is_possibly_constant_evaluated ( ) -> bool
constexprnoexcept

Query to determine if the caller may be in a constant-evaluated-context.

Returns
true if the call may be in a constant-evaluated context.
false If the call is manifestly not in a constant-evaluated context.

This trait can be used to provide both constexpr and non-constexpr specializations of an implementation when there is a performance optimization that can only be performed in non-contexpr contexts.

Note
This API is similar, but not identical to, C++20's [std::is_constant_evaluated](https://en.cppreference.com/w/cpp/types/is_constant_evaluated) . Determining if the current execution context is constant-evaluated requires compiler support through an intrinsic added specifically to allow the implementation of std::is_constant_evaluated . Therefor on compilers lacking these intrinsics, it is not possible to determine if the current context is constant-evaluated. As such, the name has been changed to reflex the loosened semantics; while is_constant_evaluated returns true IFF the current context is a constant evaluated context, is_possible_constant_evaluated returns fase IFF the current context is not a constant evaluated context. Relaxing this constraint allows code to be written in pre-C++20 contexts to perform this query, and if the compiler version supports it, benefit, while always safely falling back to the constexpr compatible implementation when compiled with compilers which do not support the intrinsic.

◆ is_power_of_2()

template<typename Integer, constraints< std::enable_if_t< std::is_integral< Integer >::value > > = nullptr>
auto arene::base::is_power_of_2 ( Integer value) -> bool
constexprnoexcept

Check if an integer is a positive power-of-two.

Template Parameters
IntegerAn integral type.
Parameters
valueThe value to test for a power-of-two.
Returns
true if the value is a positive power of two, false otherwise.

The unsigned type corresponding to the specific integer type

◆ is_valid_utf8()

auto arene::base::is_valid_utf8 ( string_view str) -> bool
inlineconstexprnoexcept

Check if a string is valid UTF-8.

This rejects any incomplete encoding sequences, any overlong encodings (e.g. 7 bit encoded in 4 bytes), any encodings of UTF-16 surrogate pair code points, and any encoding that would decode to a codepoint beyond the max Unicode codepoint of 0X10FFFF.

Parameters
strThe string to check.
Returns
true if the string is valid UTF-8
false otherwise

◆ isfinite() [1/2]

auto arene::base::isfinite ( double const num) -> bool
constexprnoexcept

Check whether or not the argument is finite, i.e. not infinity or NaN.

Parameters
numThe number to check
Returns
true if num has a finite value, otherwise false

◆ isfinite() [2/2]

auto arene::base::isfinite ( float const num) -> bool
constexprnoexcept

Check whether or not the argument is finite, i.e. not infinity or NaN.

Parameters
numThe number to check
Returns
true if num has a finite value, otherwise false

◆ isinf() [1/2]

auto arene::base::isinf ( double const num) -> bool
constexprnoexcept

Check whether or not the argument has a (positive or negative) infinite value.

Parameters
numThe number to check
Returns
true if num has an infinite value, otherwise false

◆ isinf() [2/2]

auto arene::base::isinf ( float const num) -> bool
constexprnoexcept

Check whether or not the argument has a (positive or negative) infinite value.

Parameters
numThe number to check
Returns
true if num has an infinite value, otherwise false

◆ isnan() [1/2]

auto arene::base::isnan ( double const num) -> bool
constexprnoexcept

Check whether or not the argument has a NaN value.

Parameters
numThe number to check
Returns
true if num has a NaN value, otherwise false

◆ isnan() [2/2]

auto arene::base::isnan ( float const num) -> bool
constexprnoexcept

Check whether or not the argument has a NaN value.

Parameters
numThe number to check
Returns
true if num has a NaN value, otherwise false

◆ isnormal() [1/2]

auto arene::base::isnormal ( double const num) -> bool
constexprnoexcept

Check whether or not the argument is normal, i.e. not infinity, NaN, subnormal, or zero.

Parameters
numThe number to check
Returns
true if num has a normal value, otherwise false

◆ isnormal() [2/2]

auto arene::base::isnormal ( float const num) -> bool
constexprnoexcept

Check whether or not the argument is normal, i.e. not infinity, NaN, subnormal, or zero.

Parameters
numThe number to check
Returns
true if num has a normal value, otherwise false

◆ lcm()

template<typename Integral, constraints< std::enable_if_t< std::is_integral< Integral >::value > > = nullptr>
auto arene::base::lcm ( Integral lhs,
Integral rhs ) -> Integral
constexprnoexcept

Calculates the Least Common Multiple (LCM) of two integral values.

Template Parameters
IntegralThe type of the values
Parameters
lhsFirst value
rhsSecond value
Returns
value that is LCM of lhs and rhs. If either lhs or rhs is 0, then returns 0. The result is always non-negative.

The LCM is the smallest positive integer that is divisible by both input values. It is calculated using the mathematical identity: lcm(a,b) = abs(a*b) / gcd(a,b).

◆ log2()

auto arene::base::log2 ( std::size_t value) -> std::size_t
inlineconstexprnoexcept

Computes the integer base-2 log of a value.

Parameters
valueThe value to compute the base-2 log of.
Returns
std::size_t The greatest value. x , for which 2^x<=value .
Precondition
value must be greater than zero.

◆ ltrim() [1/2]

template<std::size_t MaxLength>
auto arene::base::ltrim ( inline_string< MaxLength > const & str) -> inline_string<MaxLength>
constexpr

Create a copy of the string view with leading whitespace removed.

Template Parameters
MaxLengthThe size of the inline string
Parameters
strThe string to be trimmed
Returns
A copy of the input string with leading whitespace removed. Whitespace is defined by arene::base::whitespace_chars . An empty or all whitespace string will result in an empty return string.

◆ ltrim() [2/2]

auto arene::base::ltrim ( string_view const str) -> string_view
constexpr

Create a copy of the string view with leading whitespace removed.

Parameters
strThe string to be trimmed
Returns
A copy of the input string with leading whitespace removed. Whitespace is defined by arene::base::whitespace_chars . An empty or all whitespace string will result in an empty return string.

◆ make_non_null() [1/2]

template<typename P>
ARENE_NODISCARD constexpr auto arene::base::make_non_null ( P && ptr) -> non_null<std::decay_t<P>>
constexprnoexcept

Factory function to deduce the type of a non_null.

Template Parameters
PThe type of the pointer
Parameters
ptrThe pointer to construct the non_null from
Returns
non_null

The resulting non-null produced from the input pointer

◆ make_non_null() [2/2]

void arene::base::make_non_null ( std::nullptr_t ptr)
constexprdelete

Deleted overload for not constructing a non-null pointer from a null pointer.

Parameters
ptrThe null pointer

◆ make_non_owning_ptr()

template<typename T, constraints< std::enable_if_t< std::is_pointer< T >::value > > = nullptr>
ARENE_NODISCARD constexpr auto arene::base::make_non_owning_ptr ( T ptr)
constexprnoexcept

non_owning_ptr factory to allow template deduction.

Template Parameters
TThe raw pointer type to construct the non_owning_ptr from
Parameters
ptrThe pointer to construct the non_owning_ptr from.
Returns
Equivalent to non_owning_ptr<std::remove_pointer_t<T>>{ptr}.

◆ make_power_of_2_sequence()

template<std::size_t Begin, std::size_t End, constraints< std::enable_if_t<(End >=Begin)>>
auto arene::base::make_power_of_2_sequence ( )
constexprnoexcept

Return the sequence of 2^N for each N in the half-open range [Begin,End)

Returns
An std::index_sequence holding the values

◆ make_reverse_iterator()

template<typename Itr, constraints< std::enable_if_t< is_bidirectional_iterator_v< Itr > > > = nullptr>
auto arene::base::make_reverse_iterator ( Itr && iter) -> reverse_iterator<Itr>
constexprnoexcept

Factory function for creating a reverse_iterator with deduced template arguments pre C++17.

Template Parameters
ItrThe type of the wrapped_iterator to wrap. Must satisfy is_bidirectional_iterator_v .
Parameters
iterThe iterator to construct from.
Returns
reverse_iterator<Itr> Equivalent to reverse_iterator<Itr>{std::forward<Itr>(iter)} .

◆ make_strong_ordering()

auto arene::base::make_strong_ordering ( int const three_way_result) -> strong_ordering
inlineconstexprnoexcept

Convert an integer three-way-comparison result into a strong_ordering.

Parameters
three_way_resultThe result to convert.
Returns
strong_ordering strong_ordering::less if three_way_result is less than zero, strong_ordering::equal if three_way_result is equal to zero, and strong_ordering::greater if three_way_result is greater than zero.

◆ make_subrange()

template<typename Iterator, typename Sentinel, constraints< std::enable_if_t< denotes_range_v< Iterator, Sentinel > > > = nullptr>
auto arene::base::make_subrange ( Iterator iterator,
Sentinel sentinel ) -> make_subrange_detail::iterator_range<Iterator, Sentinel>
constexprnoexcept

Combine an iterator and sentinel into a range type that can be used with range-based for loops.

Template Parameters
IteratorThe type of the position iterator for the range
SentinelThe type of the sentinel for the range
Parameters
iteratorThe iterator
sentinelThe sentinel
Returns
A range object for the iterator/sentinel pair

◆ move()

template<class InIterator, class OutIterator, constraints< std::enable_if_t< base::is_input_iterator_v< InIterator > >, std::enable_if_t< base::is_output_iterator_v< OutIterator > >, std::enable_if_t< std::is_assignable<, typename std::iterator_traits< InIterator >::value_type && >::value > > = nullptr>
auto arene::base::move ( InIterator first,
InIterator last,
OutIterator output ) -> OutIterator
constexprnoexcept

Moves the elements in the range [first, last), to another range beginning at output, starting from first and proceeding to last - 1. After this operation the elements in the moved-from range will still contain valid values of the appropriate type, but not necessarily the same values as before the move.

Template Parameters
InIteratorThe type of the Iterator for the range to take items from
OutIteratorThe type of the Iterator for the range to put items into
Parameters
firstStart of the range to take items from
lastEnd (exclusive) of the range to take items from
outputStart of the range to put items into
Returns
OutIterator for the element past the last moved item

◆ move_backward()

template<class InIterator, class OutIterator, constraints< std::enable_if_t< base::is_input_iterator_v< InIterator > >, std::enable_if_t< base::is_output_iterator_v< OutIterator > >, std::enable_if_t< std::is_assignable<, typename std::iterator_traits< InIterator >::value_type && >::value > > = nullptr>
auto arene::base::move_backward ( InIterator first,
InIterator last,
OutIterator result ) -> OutIterator
constexprnoexcept

Moves the elements from the range [first, last), to another range ending at result. The elements are moved in reverse order (the last element is moved first), but their relative order is preserved.

Template Parameters
InIteratorThe type of the Iterator for the range to take items from
OutIteratorThe type of the Iterator for the range to put items into
Parameters
firstStart of the range to take items from
lastEnd (exclusive) of the range to take items from
resultStart of the range to put items into
Returns
OutIterator for the last moved item

◆ next()

template<typename Iterator, constraints< std::enable_if_t< is_input_iterator_v< Iterator > > > = nullptr>
ARENE_NODISCARD constexpr auto arene::base::next ( Iterator itr,
typename std::iterator_traits< Iterator >::difference_type steps = 1 ) -> Iterator
constexprnoexcept

Produces the Nth successor (or predecessor if steps is negative) of an iterator.

Template Parameters
IteratorThe iterator to advance. Does not participate in overload resolution unless Iterator is at least an input iterator.
Parameters
itrThe iterator to advance
stepsThe number of steps to advance the iterator by
Precondition
If incrementing or decrementing itr steps times results in attempting to produce an invalid iterator such as past-the-end or before-the-begin, behavior is undefined.
If Iterator is an input iterator, steps is not negative, else ARENE_PRECONDITION violation.
Returns
The iterator produced by incrementing/decrementing itr steps times.

◆ on_scope_exit()

template<typename CallableType, constraints< std::enable_if_t< is_nothrow_invocable_r_v< void, CallableType > > > = nullptr>
ARENE_NODISCARD auto arene::base::on_scope_exit ( CallableType && func) -> scope_guard<remove_cvref_t<CallableType>>
noexcept

Declarative helper for constructing scope_guard instances.

A simple factory function for scope_guard with a declarative name that makes its purpose clear. Example usage:

/// @brief Some operation that might throw.
/// @param value A value needed for the operator.
/// @param handle A handle to the resource to perform the operation on.
/// @throws std::out_of_range if @c value is less than 0.
auto might_throw(int value, resource_handle handle) -> int;
/// @brief Example of using scope_guard directly
/// @param value The value to pass to @c might_throw
void basic_usage(int value) {
resource_handle const handle = allocate_resource();
auto const always_free = arene::base::on_scope_exit([&handle]() noexcept { free_resource(handle); });
might_throw(value, handle);
}
Template Parameters
CallableTypea callable with signature void(void) noexcept . Must be move-copyable and decay constructible.
Parameters
funcThe callable to invoke upon destruction of the returned scope_guard object.
Returns
scope_guard A scope_guard instance initialized from func through forwarding.

◆ operator&()

auto arene::base::operator& ( byte const lhs,
byte const rhs ) -> byte
constexprnoexcept

Bit-wise and of the byte representations.

Parameters
lhsThe first value
rhsThe second value
Returns
The result of bitwise and of lhs and rhs

◆ operator&=()

auto arene::base::operator&= ( byte & lhs,
byte const rhs ) -> byte&
constexprnoexcept

Modify lhs by bit-wise and'ing it with the bits of rhs.

Parameters
lhsThe value to modify
rhsThe second value
Returns
A reference to lhs

◆ operator<<()

template<typename IntegerType, constraints< std::enable_if_t< std::is_integral< IntegerType >::value > > = nullptr>
auto arene::base::operator<< ( byte const val,
IntegerType const shift ) -> byte
constexprnoexcept

Left-shift the bits of val by shift.

Template Parameters
IntegerTypeThe type of integer to shift by
Parameters
valThe byte to shift
shiftThe number of bits to shift by
Returns
The result of shifting val left by shift bits
Precondition
shift < CHAR_BIT, otherwise ARENE_PRECONDITION violation

◆ operator<<=()

template<typename IntegerType, constraints< std::enable_if_t< std::is_integral< IntegerType >::value > > = nullptr>
auto arene::base::operator<<= ( byte & val,
IntegerType const shift ) -> byte&
constexprnoexcept

Modify val by shifting its bits left by shift.

Parameters
valThe value to shift
shiftThe number of bits to shift by
Returns
A reference to val

◆ operator>>()

template<typename IntegerType, constraints< std::enable_if_t< std::is_integral< IntegerType >::value > > = nullptr>
auto arene::base::operator>> ( byte const val,
IntegerType const shift ) -> byte
constexprnoexcept

Right-shift the bits of val by shift.

Template Parameters
IntegerTypeThe type of integer to shift by.
Parameters
valThe byte to shift
shiftThe number of bits to shift by
Returns
The result of shifting val right by shift bits
Precondition
shift < CHAR_BIT, otherwise ARENE_PRECONDITION violation

◆ operator>>=()

template<typename IntegerType, constraints< std::enable_if_t< std::is_integral< IntegerType >::value > > = nullptr>
auto arene::base::operator>>= ( byte & val,
IntegerType const shift ) -> byte&
constexprnoexcept

Modify val by shifting its bits right by shift.

Parameters
valThe value to shift
shiftThe number of bits to shift by
Returns
A reference to val

◆ operator^()

auto arene::base::operator^ ( byte const lhs,
byte const rhs ) -> byte
constexprnoexcept

Bit-wise xor of the byte representations.

Parameters
lhsThe first value
rhsThe second value
Returns
The result of bitwise xor of lhs and rhs

◆ operator^=()

auto arene::base::operator^= ( byte & lhs,
byte const rhs ) -> byte&
constexprnoexcept

Modify lhs by bit-wise xor'ing it with the bits of rhs.

Parameters
lhsThe value to modify
rhsThe second value
Returns
A reference to val

◆ operator|()

auto arene::base::operator| ( byte const lhs,
byte const rhs ) -> byte
constexprnoexcept

Bit-wise or of the byte representations.

Parameters
lhsThe first value
rhsThe second value
Returns
The result of bitwise or of lhs and rhs

◆ operator|=()

auto arene::base::operator|= ( byte & lhs,
byte const rhs ) -> byte&
constexprnoexcept

Modify lhs by bit-wise or'ing it with the bits of rhs.

Parameters
lhsThe value to modify
rhsThe second value
Returns
A reference to lhs

◆ operator~()

auto arene::base::operator~ ( byte const val) -> byte
constexprnoexcept

Bit-wise negation of the byte representation.

Parameters
valThe value to negate
Returns
The result of bitwise negation of val

◆ opposite_ordering()

auto arene::base::opposite_ordering ( strong_ordering const ordering) -> strong_ordering
inlineconstexprnoexcept

Return the opposite ordering for a strong_ordering three-way-comparison result.

Parameters
orderingThe ordering to convert.
Returns
strong_ordering strong_ordering::greater if ordering is strong_ordering::less, strong_ordering::equal if ordering is strong_ordering::equal, and strong_ordering::less if ordering is strong_ordering::greater.

◆ power_of_2()

auto arene::base::power_of_2 ( std::uint64_t const value) -> std::uint64_t
inlineconstexprnoexcept

Raises 2 to the power of a value.

Parameters
valueThe value to raise two to the power of.
Returns
std::uint64_t 2^value
Precondition
value < the number of bits in std::uint64_t , or else precondition violation.
Note
std::size_t is 32 bits on some platforms that define std::uint64_t

◆ prev()

template<typename Iterator, constraints< std::enable_if_t< is_bidirectional_iterator_v< Iterator > > > = nullptr>
ARENE_NODISCARD constexpr auto arene::base::prev ( Iterator itr,
typename std::iterator_traits< Iterator >::difference_type steps = 1 ) -> Iterator
constexprnoexcept

Produces the Nth predecessor (or successor if steps is negative) of an iterator.

Template Parameters
IteratorThe iterator to advance. Does not participate in overload resolution unless Iterator is at least a bidirectional iterator.
Parameters
itrThe iterator to advance
stepsThe number of steps to advance the iterator by
Precondition
If incrementing or decrementing itr steps times results in attempting to produce an invalid iterator such as past-the-end or before-the-begin, behavior is undefined.
steps is not std::numeric_limits<difference_type>::min() , else behavior is undefined.
Returns
The iterator produced by incrementing/decrementing itr steps times.

◆ read_big_endian() [1/2]

template<typename T, constraints< std::enable_if_t< std::is_integral< T >::value > > = nullptr>
auto arene::base::read_big_endian ( span< byte const, sizeof(T)> bytes) -> T
constexprnoexcept

Read a value from a serialized binary representation stored in big-endian byte order.

Template Parameters
TThe type of the value to read.
Parameters
bytesA view of the bytes to read the data from.
Returns
The read value

◆ read_big_endian() [2/2]

template<typename T, constraints< std::enable_if_t<!std::is_enum< T >::value >, std::enable_if_t<!std::is_arithmetic< T >::value > > = nullptr>
auto arene::base::read_big_endian ( span< byte const, sizeof(T)> bytes) -> T
deletenoexcept

Read a value from a serialized binary representation stored in big-endian byte order.

Template Parameters
TThe type of the value to read.
Parameters
bytesA view of the bytes to read the data from.
Returns
The read value

◆ read_little_endian() [1/2]

template<typename T, constraints< std::enable_if_t< std::is_integral< T >::value > > = nullptr>
auto arene::base::read_little_endian ( span< byte const, sizeof(T)> bytes) -> T
constexprnoexcept

Read an integral value from a serialized binary representation stored in little-endian byte order.

Read an enum value from a serialized binary representation stored in little-endian byte order.

Template Parameters
TThe type of the value to read.
Parameters
bytesA view of the bytes to read the data from.
Returns
The read value

◆ read_little_endian() [2/2]

template<typename T, constraints< std::enable_if_t<!std::is_enum< T >::value >, std::enable_if_t<!std::is_arithmetic< T >::value > > = nullptr>
auto arene::base::read_little_endian ( span< byte const, sizeof(T)> bytes) -> T
deletenoexcept

Read a value from a serialized binary representation stored in little-endian byte order.

Read a floating point value from a serialized binary representation stored in little-endian byte order.

Template Parameters
TThe type of the value to read.
Parameters
bytesA view of the bytes to read the data from.
Returns
The read value

◆ REGISTER_TYPED_TEST_SUITE_P() [1/2]

arene::base::REGISTER_TYPED_TEST_SUITE_P ( InlineDequeDeathTest ,
PushFrontMoreThanCapacity ,
PushBackMoreThanCapacity ,
NonWrappingInsertOneWhenFull ,
BackWhenEmpty ,
ConstBackWhenEmpty ,
PopFrontWhenEmpty ,
PopBackWhenEmpty ,
FrontWhenEmpty ,
ConstFrontWhenEmpty ,
CopyConstructFromBackwardRange ,
CopyConstructFromOversizedRange ,
MoveConstructFromBackwardRange ,
MoveConstructFromOversizedRange ,
ConstructFromOversizedInitializerList ,
DereferencingEndIteratorIsPreconditionViolation ,
DereferencingBeginOfEmptyDequeIsPreconditionViolation ,
DefaultConstructedIteratorCantBeUsed ,
DefaultConstructedConstIteratorCantBeUsed ,
IteratorOrderingFromDifferentDequesIsPreconditionViolation ,
SubtractingIteratorByMinimumValueIsPreconditionViolation  )

◆ REGISTER_TYPED_TEST_SUITE_P() [2/2]

arene::base::REGISTER_TYPED_TEST_SUITE_P ( InlineDequeTest ,
CanConstruct ,
CapacityIsAsSpecified ,
CapacityIsNoexcept ,
SizeIsNoexcept ,
PushFrontOneElement ,
PushBackOneElement ,
EmplaceFrontReturnsReference ,
EmplaceBackReturnsReference ,
FrontPushedElementIsCorrect ,
BackPushedElementIsCorrect ,
PushFrontWithinCapacity ,
PushBackWithinCapacity ,
PushFrontDetailCoverage ,
InsertConstraints ,
CopyInsertOne ,
MoveInsertOne ,
CopyInsertOneAtEnd ,
MoveInsertOneAtEnd ,
GoCircularFromFront ,
GoCircularFromBack ,
BasicFunctionFromFront ,
BasicFunctionFromBack ,
CanObserveAndModifyFromFront ,
CanObserveAndModifyFromBack ,
PushFrontCopiesLvalues ,
PushBackCopiesLvalues ,
NotCopyConstructibleIfDataTypeNotCopyConstructible ,
NotMoveConstructibleIfDataTypeNotMoveConstructible ,
NotCopyAssignableIfDataTypeNotCopyConstructibleAndCopyAssignable ,
NotMoveAssignableIfDataTypeNotMoveConstructibleAndMoveAssignable ,
CanConstructAtCompileTime ,
RangeConstructionSfinae ,
RangeConstructionNoexcept ,
CopyConstructFromRange ,
MoveConstructFromRange ,
InitializerListConstructionSfinae ,
InitializerListConstructionNoexcept ,
ConstructFromInitializerList ,
ConstructFromEmptyList ,
TryCopyConstructFromBackwardRange ,
TryCopyConstructFromOversizedRange ,
TryMoveConstructFromBackwardRange ,
TryMoveConstructFromOversizedRange ,
TryConstructFromOversizedInitializerList ,
CanCopyConstruct ,
CanCopyTryConstruct ,
CanMoveConstruct ,
CanMoveTryConstruct ,
CanCopyAssign ,
SelfCopyAssign ,
CanMoveAssign ,
SelfMoveAssign ,
CopyAssignIntoPartiallyFull ,
CopyAssignFromPartiallyFull ,
MoveAssignIntoPartiallyFull ,
MoveAssignFromPartiallyFull ,
IteratorsAreRandomAccessAndNoexcept ,
NonConstIteratorsImplicitlyConvertibleToConst ,
InspectWithIterators ,
IteratorsWrapAround ,
MutableIteratorsWork ,
InspectWithReverseIterators ,
MutableReverseIteratorsWork ,
IteratorsNotInvalidatedByPopFront ,
IteratorsNotInvalidatedByPopBack ,
BinaryPlusEquivalentToPlusEquals ,
BinaryMinusEquivalentToMinusEquals ,
IteratorBracketOperatorEquivalentToBinaryPlus ,
ContainerBracketOperatorEquivalentToIteratorBracketOperator ,
AnyIteratorDifferenceReturnsDistance ,
IteratorForwardMovementIsTheSameAsRepeatedIncrementing ,
IteratorBackwardMovementIsTheSameAsRepeatedDecrementing ,
IteratorsIncrementedOutOfBoundsBecomeEnd ,
EmptyDequeBeginEqualsEnd ,
IteratorsAreOrdered  )

◆ rtrim() [1/2]

template<std::size_t MaxLength>
auto arene::base::rtrim ( inline_string< MaxLength > const & str) -> inline_string<MaxLength>
constexpr

Create a copy of the string view with trailing whitespace removed.

Template Parameters
MaxLengthThe size of the inline string
Parameters
strThe string_view reference to be trimmed
Returns
A copy of the input string with trailing whitespace removed. Whitespace is defined by arene::base::whitespace_chars . An empty or all whitespace string will result in an empty return string.

◆ rtrim() [2/2]

auto arene::base::rtrim ( string_view const str) -> string_view
constexpr

Create a copy of the string view with trailing whitespace removed.

Parameters
strThe string_view reference to be trimmed
Returns
A copy of the input string with trailing whitespace removed. Whitespace is defined by arene::base::whitespace_chars . An empty or all whitespace string will result in an empty return string.

◆ signbit() [1/2]

auto arene::base::signbit ( double const num) -> bool
constexprnoexcept

Check the sign bit of a floating point number.

Parameters
numThe number to check
Returns
true if num is negative (i.e. its sign bit is 1), false if num is positive

◆ signbit() [2/2]

auto arene::base::signbit ( float const num) -> bool
constexprnoexcept

Check the sign bit of a floating point number.

Parameters
numThe number to check
Returns
true if num is negative (i.e. its sign bit is 1), false if num is positive

◆ swap_ranges()

template<class SourceIterator, class DestIterator, constraints< std::enable_if_t< is_input_iterator_v< SourceIterator > >, std::enable_if_t< is_input_iterator_v< DestIterator > >, std::enable_if_t< is_output_iterator_v< SourceIterator > >, std::enable_if_t< is_output_iterator_v< DestIterator > > > = nullptr>
auto arene::base::swap_ranges ( SourceIterator first1,
SourceIterator last1,
DestIterator first2 ) -> DestIterator
constexprnoexcept

Exchanges elements between range [first1, last1) and another range starting at first2. Precondition: the two ranges [first1, last1) and [first2, last2) do not overlap, where last2 = std::next(first2, std::distance(first1, last1)).

Template Parameters
SourceIteratorThe type of the Iterator for the first range
DestIteratorThe type of the Iterator for the second range
Parameters
first1Beginning of the first range of elements to swap
last1End of the first range of elements to swap
first2Beginning of the second range of elements to swap
Returns
End of the second range of swapped elements // CODEQLFP(EXP52-CPP) // CODEQLFP(DCL51-CPP)

◆ throw_errno_as_system_error()

ARENE_NORETURN void arene::base::throw_errno_as_system_error ( )
inline

Throw std::system_error based on the value of errno.

Exceptions
std::system_error

◆ to_array() [1/2]

template<typename T, std::size_t Size, constraints< std::enable_if_t<!std::is_array< T >::value >, std::enable_if_t< std::is_move_constructible< base::remove_cvref_t< T > >::value > > = nullptr>
auto arene::base::to_array ( T(&&) arr[Size]) -> array<base::remove_cvref_t<T>, Size>
constexprnoexcept

Internal function to construct an array from an rvalue C-style array, using the specified indices.

Template Parameters
TThe type of the array elements
SizeThe number of array elements
Parameters
arrThe source array
Returns
The constructed array

◆ to_array() [2/2]

template<typename T, std::size_t Size, constraints< std::enable_if_t<!std::is_array< T >::value >, std::enable_if_t< std::is_constructible< base::remove_cvref_t< T >, T & >::value > > = nullptr>
auto arene::base::to_array ( T(&) arr[Size]) -> array<base::remove_cvref_t<T>, Size>
constexprnoexcept

Function to construct an array from a C-style array, using the specified indices.

Template Parameters
TThe type of the array elements
SizeThe number of array elements
Parameters
arrThe source array
Returns
The constructed array

◆ to_byte()

template<typename ValueType, constraints< std::enable_if_t< std::is_integral< ValueType >::value > > = nullptr>
auto arene::base::to_byte ( ValueType const val) -> byte
constexprnoexcept

Convert an integer to an arene::base::byte.

Template Parameters
ValueTypeThe type of the integer.
Parameters
valThe value to convert
Returns
The supplied value, cast to byte

◆ to_inline_string() [1/2]

template<typename T = bool, std::size_t S = to_string_detail::required_decimal_digits_v<T>, constraints< std::enable_if_t< to_string_detail::is_large_enough_for< T, S > > > = nullptr>
auto arene::base::to_inline_string ( bool value) -> inline_string<S>
inlineconstexprnoexcept

Produces a string representation of an input boolean value.

Template Parameters
SThe size of the inline string to write the result to. Must be at least 5 characters.
Parameters
valueThe value to convert.
Returns
inline_string with the boolean represented as either "true" or "false".

◆ to_inline_string() [2/2]

template<typename T, std::size_t S = to_string_detail::required_decimal_digits_v<T>, constraints< std::enable_if_t< std::is_integral< T >::value >, std::enable_if_t< to_string_detail::is_large_enough_for< T, S > > > = nullptr>
auto arene::base::to_inline_string ( T value) -> inline_string<S>
inlineconstexprnoexcept

Produces a string representation of an input integral value in base-10.

Template Parameters
TThe type of the value to convert.
SThe size of the inline string to write the result to. Must be large enough to hold T.
Parameters
valueThe value to convert.
Returns
inline_string with a character representation of the input value in base-10, with no padding.

◆ to_integer()

template<typename IntegerType, constraints< std::enable_if_t< std::is_integral< IntegerType >::value > > = nullptr>
auto arene::base::to_integer ( byte const val) -> IntegerType
constexprnoexcept

convert the byte value to an integral representation.

Template Parameters
IntegerTypeThe type of integer to convert to.
Parameters
valThe byte to convert.
Returns
The integral value of val.

◆ to_string()

auto arene::base::to_string ( string_view const str) -> std::string

Construct a std::string from the string_view.

Parameters
strThe string_view to convert
Returns
A new std::string holding a copy of the string from the view

◆ to_underlying()

template<class T>
auto arene::base::to_underlying ( T value) -> std::underlying_type_t<T>
constexprnoexcept

This replicates a function that went into C++23 called std::to_underlying (https://wg21.link/P1682). It automatically processes and figures out the type of an enumeration value.

Remarks
Usage sites benefit from this function in that they can never accidentally forget to update the code at several places when it comes to converting between an enumeration and its type. This can avoid problems with casting to the wrong type and getting bad integer promotions or signed -> unsigned (or vice-versa) conversions.
Template Parameters
TThe type of the numeration for which to return the underlying value
Parameters
valueThe value of type T for which to retrieve the underlying value
Returns
The integral value of the supplied enumeration value

◆ trim() [1/2]

template<std::size_t MaxLength>
auto arene::base::trim ( inline_string< MaxLength > const & str) -> inline_string<MaxLength>
constexpr

Create a copy of the string view with leading and trailing whitespace removed.

Template Parameters
MaxLengthThe size of the inline string
Parameters
strThe string_view reference to be trimmed
Returns
A copy of the input string with leading and trailing whitespace removed. Whitespace is defined by arene::base::whitespace_chars . An empty or all whitespace string will result in an empty return string.

◆ trim() [2/2]

auto arene::base::trim ( string_view const str) -> string_view
constexpr

Create a copy of the string view with leading and trailing whitespace removed.

Parameters
strThe string_view reference to be trimmed
Returns
A copy of the input string with leading and trailing whitespace removed. Whitespace is defined by arene::base::whitespace_chars . An empty or all whitespace string will result in an empty return string.

◆ TYPED_TEST_P() [1/57]

arene::base::TYPED_TEST_P ( InlineDequeDeathTest ,
BackWhenEmpty  )
Test
when the inline_deque is empty, back terminates the application with a precondition violation

◆ TYPED_TEST_P() [2/57]

arene::base::TYPED_TEST_P ( InlineDequeDeathTest ,
ConstBackWhenEmpty  )
Test
when the inline_deque is empty, the const overload of back terminates the application with a precondition violation

◆ TYPED_TEST_P() [3/57]

arene::base::TYPED_TEST_P ( InlineDequeDeathTest ,
ConstFrontWhenEmpty  )
Test
when the inline_deque is empty, the const overload of front terminates the application with a precondition violation

◆ TYPED_TEST_P() [4/57]

arene::base::TYPED_TEST_P ( InlineDequeDeathTest ,
DefaultConstructedConstIteratorCantBeUsed  )
Test
Default-constructed instances of any deque's const iterators cause crashes when incremented or dereferenced

◆ TYPED_TEST_P() [5/57]

arene::base::TYPED_TEST_P ( InlineDequeDeathTest ,
DefaultConstructedIteratorCantBeUsed  )
Test
Default-constructed instances of any deque's iterators cause crashes when incremented or dereferenced

◆ TYPED_TEST_P() [6/57]

arene::base::TYPED_TEST_P ( InlineDequeDeathTest ,
DereferencingBeginOfEmptyDequeIsPreconditionViolation  )
Test
When created on an empty deque, dereferencing the begin iterator of any iterator type causes a crash

◆ TYPED_TEST_P() [7/57]

arene::base::TYPED_TEST_P ( InlineDequeDeathTest ,
DereferencingEndIteratorIsPreconditionViolation  )
Test
Dereferencing the end iterator of any iterator type causes a crash

◆ TYPED_TEST_P() [8/57]

arene::base::TYPED_TEST_P ( InlineDequeDeathTest ,
FrontWhenEmpty  )
Test
when the inline_deque is empty, front terminates the application with a precondition violation

◆ TYPED_TEST_P() [9/57]

arene::base::TYPED_TEST_P ( InlineDequeDeathTest ,
IteratorOrderingFromDifferentDequesIsPreconditionViolation  )
Test
Trying to compare iterators for ordering when they come from two different deques causes a crash

◆ TYPED_TEST_P() [10/57]

arene::base::TYPED_TEST_P ( InlineDequeDeathTest ,
MoveConstructFromBackwardRange  )
Test
inline_deque crashes when move constructed from a range with the iterators in the wrong order

◆ TYPED_TEST_P() [11/57]

arene::base::TYPED_TEST_P ( InlineDequeDeathTest ,
MoveConstructFromOversizedRange  )
Test
inline_deque crashes when move constructed from a range that's too large to fit within the capacity

◆ TYPED_TEST_P() [12/57]

arene::base::TYPED_TEST_P ( InlineDequeDeathTest ,
PopFrontWhenEmpty  )
Test
when the inline_deque is empty, pop_front terminates the application with a precondition violation

◆ TYPED_TEST_P() [13/57]

arene::base::TYPED_TEST_P ( InlineDequeDeathTest ,
PushBackMoreThanCapacity  )
Test
Inserting any element beyond an inline_deque's capacity terminates the application with a precondition violation or wraps, depending on its parameters

◆ TYPED_TEST_P() [14/57]

arene::base::TYPED_TEST_P ( InlineDequeDeathTest ,
SubtractingIteratorByMinimumValueIsPreconditionViolation  )
Test
Trying to subtract the most negative possible difference from an iterator causes a precondition violation

◆ TYPED_TEST_P() [15/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
AnyIteratorDifferenceReturnsDistance  )
Test
Binary operator- between any two iterators returns the distance between them

◆ TYPED_TEST_P() [16/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
BackPushedElementIsCorrect  )
Test
Given a default-constructed inline_deque with plenty of capacity, an element can be inserted via push_back and then inspected

◆ TYPED_TEST_P() [17/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
BinaryMinusEquivalentToMinusEquals  )
Test
Using binary operator- on an iterator and a difference gives the same result as using operator-= on them

◆ TYPED_TEST_P() [18/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
BinaryPlusEquivalentToPlusEquals  )
Test
Using binary operator+ on an iterator gives the same result as using operator+= on a copy of it

◆ TYPED_TEST_P() [19/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
CanConstruct  )
Test
A default-constructed inline_deque has size equal to zero

◆ TYPED_TEST_P() [20/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
CanMoveAssign  )
Test
inline_deque move-assignment works as expected

◆ TYPED_TEST_P() [21/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
CanMoveConstruct  )
Test
inline_deque move-construction works as expected

◆ TYPED_TEST_P() [22/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
CanMoveTryConstruct  )
Test
inline_deque move-construction works as expected when invoked via try_construct

◆ TYPED_TEST_P() [23/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
CapacityIsAsSpecified  )
Test
The capacity of a default-constructed inline_deque is equal to the supplied template parameter

◆ TYPED_TEST_P() [24/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
CapacityIsNoexcept  )
Test
The capacity member function of inline_deque is declared noexcept

◆ TYPED_TEST_P() [25/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
ContainerBracketOperatorEquivalentToIteratorBracketOperator  )
Test
Using operator[] on the deque gives the same result as using operator[] on begin()

◆ TYPED_TEST_P() [26/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
EmplaceBackReturnsReference  )
Test
Emplacing an element into the back of an inline_deque returns a reference to the emplaced element

◆ TYPED_TEST_P() [27/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
EmptyDequeBeginEqualsEnd  )
Test
When created on an empty deque, the begin and end pair of each iterator type equal each other

◆ TYPED_TEST_P() [28/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
GoCircularFromBack  )
Test
inline_deque has circular or ring-buffer behavior, such that when previously inserted elements via push_back are removed via pop_front, then space in the fixed-capacity storage of the deque is made available for new elements to be inserted

◆ TYPED_TEST_P() [29/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
InitializerListConstructionNoexcept  )
Test
inline_deque initializer list construction has the correct noexcept specification

◆ TYPED_TEST_P() [30/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
InitializerListConstructionSfinae  )
Test
inline_deque initializer list construction is enabled or disabled appropriately based on the value type

◆ TYPED_TEST_P() [31/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
InspectWithIterators  )
Test
Inspecting a deque using its iterators yields the elements from front to back

◆ TYPED_TEST_P() [32/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
InspectWithReverseIterators  )
Test
Inspecting a deque using its reverse iterators yields the elements from back to front

◆ TYPED_TEST_P() [33/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
IteratorBackwardMovementIsTheSameAsRepeatedDecrementing  )
Test
Decrementing an iterator all at once is the same as repeatedly decrementing it one step

◆ TYPED_TEST_P() [34/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
IteratorBracketOperatorEquivalentToBinaryPlus  )
Test
Using operator[] on an iterator gives the same result as using binary operator+ and unary operator*

◆ TYPED_TEST_P() [35/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
IteratorForwardMovementIsTheSameAsRepeatedIncrementing  )
Test
Incrementing an iterator all at once is the same as repeatedly incrementing it one step

◆ TYPED_TEST_P() [36/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
IteratorsAreOrdered  )
Test
Iterators to the same deque are ordered with respect to each other in the way they're supposed to be

◆ TYPED_TEST_P() [37/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
IteratorsAreRandomAccessAndNoexcept  )
Test
Both const and non-const iterator types for a deque are random access, and creating them is noexcept

◆ TYPED_TEST_P() [38/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
IteratorsIncrementedOutOfBoundsBecomeEnd  )
Test
Incrementing an iterator by exactly enough to go out of bounds causes it to become the end iterator

◆ TYPED_TEST_P() [39/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
IteratorsWrapAround  )
Test
Inspecting a deque using its iterators yields the elements from front to back, even when wrapping around

◆ TYPED_TEST_P() [40/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
MoveAssignFromPartiallyFull  )
Test
Move assignment works from a partially full input

◆ TYPED_TEST_P() [41/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
MoveAssignIntoPartiallyFull  )
Test
Move assignment works into a partially full target

◆ TYPED_TEST_P() [42/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
MoveConstructFromRange  )
Test
inline_deque can be constructed from a range of T using iterators

◆ TYPED_TEST_P() [43/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
MutableIteratorsWork  )
Test
The elements of a deque can be changed using its mutable iterators

◆ TYPED_TEST_P() [44/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
MutableReverseIteratorsWork  )
Test
The elements of a deque can be changed using its mutable reverse iterators

◆ TYPED_TEST_P() [45/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
NonConstIteratorsImplicitlyConvertibleToConst  )
Test
Non-const iterators are implicitly convertible to the corresponding const iterator, but not vice versa

◆ TYPED_TEST_P() [46/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
NotCopyAssignableIfDataTypeNotCopyConstructibleAndCopyAssignable  )
Test
inline_deque is not copy-assignable if the data type is not copy-constructible

◆ TYPED_TEST_P() [47/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
NotCopyConstructibleIfDataTypeNotCopyConstructible  )
Test
inline_deque is not copy-constructible if the data type is not copy-constructible

◆ TYPED_TEST_P() [48/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
NotMoveAssignableIfDataTypeNotMoveConstructibleAndMoveAssignable  )
Test
inline_deque is not move-assignable if the data type is not move-constructible

◆ TYPED_TEST_P() [49/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
NotMoveConstructibleIfDataTypeNotMoveConstructible  )
Test
inline_deque is not move-constructible if the data type is not move-constructible

◆ TYPED_TEST_P() [50/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
PushBackOneElement  )
Test
Given a default-constructed inline_deque with plenty of capacity, an element can be inserted via push_back, which causes a size increase

◆ TYPED_TEST_P() [51/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
PushBackWithinCapacity  )
Test
Given a default-constructed inline_deque, elements can be inserted via push_back within its capacity, making the size be equal to capacity

◆ TYPED_TEST_P() [52/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
RangeConstructionNoexcept  )
Test
inline_deque range construction has the correct noexcept specification

◆ TYPED_TEST_P() [53/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
RangeConstructionSfinae  )
Test
inline_deque range construction is enabled or disabled appropriately based on the arguments

◆ TYPED_TEST_P() [54/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
SelfMoveAssign  )
Test
inline_deque self move-assignment does nothing

◆ TYPED_TEST_P() [55/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
SizeIsNoexcept  )
Test
The size member function of inline_deque is declared noexcept

◆ TYPED_TEST_P() [56/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
TryMoveConstructFromBackwardRange  )
Test
try_construct returns empty when move constructing from a range with the iterators in the wrong order

◆ TYPED_TEST_P() [57/57]

arene::base::TYPED_TEST_P ( InlineDequeTest ,
TryMoveConstructFromOversizedRange  )
Test
try_construct returns empty when move constructing from a range that's too large to fit within the capacity

◆ TYPED_TEST_SUITE_P() [1/2]

arene::base::TYPED_TEST_SUITE_P ( InlineDequeDeathTest )

◆ TYPED_TEST_SUITE_P() [2/2]

arene::base::TYPED_TEST_SUITE_P ( InlineDequeTest )

◆ value_result() [1/2]

auto arene::base::value_result ( ) -> value_result_t<void>
inlineconstexprnoexcept

Convenience function to construct a result<void,Error> .

Example Usage:

// Make "result" contain a "value", even though there are no objects of type "void"
arene::base::result<void, Bar> res = arene::base::value_result();
Returns
value_result_t An object which is move-convertible to any result<void,Error> .

◆ value_result() [2/2]

template<typename ValueType>
auto arene::base::value_result ( ValueType && value) -> value_result_t<std::remove_reference_t<ValueType>>
constexprnoexcept

Convenience function to construct a result<ValueType,Error> containing the ValueType from any reference.

Example Usage:

// Make "result" contain a "Foo" value object, initialized as "Foo(1, 2)"
arene::base::result<Foo, Bar> res = arene::base::value_result(Foo(1, 2));
Template Parameters
ValueTypethe value_type of the produced result.
Parameters
valuevalue to instantiate the result with.
Returns
value_result_t An object which is move-convertible to any result<ValueType,Error> .

◆ visit() [1/2]

template<typename RetT, typename VisitorT, typename VariantT>
auto arene::base::visit ( VisitorT && visitor,
VariantT && vrnt ) -> RetT
noexcept

Invokes a given visitor with the active alternative in a given variant.

Template Parameters
RetTThe type to coerce all return types to.
VisitorTThe type of the visitor to invoke.
VariantTThe type of the variant to unwrap. Given variant<Ts...> , is_invocable_r<RetT,VisitorT,Ts> must hold where Visitor and Ts maintain the cref qualification visitor and variant respectively.
Parameters
visitorThe visitor to invoke.
vrntThe variant to take the active alternative of.
Returns
RetT The result of invoking visitor with the active alternative in vrnt , converted to RetT .
Precondition
vrnt.valueless_by_exception()==false , else ARENE_PRECONDITION violation.

◆ visit() [2/2]

template<typename VisitorT, typename VariantT>
auto arene::base::visit ( VisitorT && visitor,
VariantT && vrnt ) -> visit_detail::visitor_invoke_result_t< , >
noexcept

Invokes a given visitor with the active alternative in a given variant.

Template Parameters
VisitorTThe type of the visitor to invoke.
VariantTThe type of the variant to unwrap. Given variant<Ts...> , is_invocable<VisitorT,Ts> must hold where Visitor and Ts maintain the cref qualification of Ts.
Parameters
visitorThe visitor to invoke.
vrntThe variant to take the active alternative of.
Returns
The result of invoking visitor with the active alternative in vrnt .
Precondition
vrnt.valueless_by_exception()==false , else ARENE_PRECONDITION violation.

◆ whitespace_chars()

auto arene::base::whitespace_chars ( ) -> string_view
inlineconstexpr

Characters defined as whitespace to be trimmed.

Returns
sequence of whitespace characters

◆ write_big_endian() [1/2]

template<typename T, constraints< std::enable_if_t< std::is_integral< T >::value > > = nullptr>
void arene::base::write_big_endian ( base::type_identity_t< T > value,
span< byte, sizeof(T)> bytes )
constexprnoexcept

Write a value to a buffer in big-endian binary representation.

Template Parameters
TThe type of the value to write. This template parameter must be explicitly specified.
Parameters
valueThe value to write.
bytesThe buffer to write the big-endian binary representation to.

◆ write_big_endian() [2/2]

template<typename T, constraints< std::enable_if_t<!std::is_enum< T >::value >, std::enable_if_t<!std::is_arithmetic< T >::value > > = nullptr>
void arene::base::write_big_endian ( base::type_identity_t< T > value,
span< byte, sizeof(T)> bytes )
deletenoexcept

Write a value to a buffer in big-endian binary representation.

Template Parameters
TThe type of the value to write. This template parameter must be explicitly specified.
Parameters
valueThe value to write.
bytesThe buffer to write the big-endian binary representation to.

◆ write_little_endian() [1/2]

template<typename T, constraints< std::enable_if_t< std::is_integral< T >::value > > = nullptr>
void arene::base::write_little_endian ( base::type_identity_t< T > value,
span< byte, sizeof(T)> bytes )
constexprnoexcept

Write an integral value to a buffer in little-endian binary representation.

Write an enum value to a buffer in little-endian binary representation.

Template Parameters
TThe type of the value to write. This template parameter must be explicitly specified.
Parameters
valueThe value to write.
bytesThe buffer to write the little-endian binary representation to.

◆ write_little_endian() [2/2]

template<typename T, constraints< std::enable_if_t<!std::is_enum< T >::value >, std::enable_if_t<!std::is_arithmetic< T >::value > > = nullptr>
void arene::base::write_little_endian ( base::type_identity_t< T > value,
span< byte, sizeof(T)> bytes )
deletenoexcept

Write a value to a buffer in little-endian binary representation.

Write a floating point value to a buffer in little-endian binary representation.

Template Parameters
TThe type of the value to write. This template parameter must be explicitly specified.
Parameters
valueThe value to write.
bytesThe buffer to write the little-endian binary representation to.

Variable Documentation

◆ is_tuple_like_v< T, constraints< std::enable_if_t< std::tuple_size< remove_cvref_t< T > >::value !=0U >, std::enable_if_t< tuple_like_detail::get_result_is_tuple_element_ref< remove_cvref_t< T >, 0U > >, std::enable_if_t< tuple_like_detail::get_result_is_tuple_element_ref< remove_cvref_t< T >, std::tuple_size< remove_cvref_t< T > >::value - 1U > > > >

template<typename T>
bool arene::base::is_tuple_like_v< T, constraints< std::enable_if_t< std::tuple_size< remove_cvref_t< T > >::value !=0U >, std::enable_if_t< tuple_like_detail::get_result_is_tuple_element_ref< remove_cvref_t< T >, 0U > >, std::enable_if_t< tuple_like_detail::get_result_is_tuple_element_ref< remove_cvref_t< T >, std::tuple_size< remove_cvref_t< T > >::value - 1U > > > > = true
externconstexpr

Type trait to check if a type implements the tuple protocol.

Note
A type implements the tuple protocol if it has get<Idx>() functions and specializations of std::tuple_size and std::tuple_element. The get<Idx>() implementations can either be member functions or free functions found by ADL; if both are present, the member functions are preferred.

Types implementing the tuple protocol can be used with structured bindings. Standard classes like std::tuple, std::pair, and std::array implement the tuple protocol, as does arene::base::array.

This trait checks that get<0>() and get<size-1>() both return types that are reference-compatible with tuple_element at the same index (convertible to tuple_element_t const&, for each of the four value categories of T). Intermediate indices are not checked for performance reasons. If tuple_size<T> == 0, the type is considered to be tuple-like regardless of the presence or behaviour of get and tuple_element.

Template Parameters
TThe type to check

◆ all_are_same_v

template<class... T>
bool arene::base::all_are_same_v = sizeof...(T) < 2
externconstexpr

A bool variable template that is true if all parameters are the same type, otherwise false.

Note
Not an ODR violation to ODR use a variable template definition from multiple translation units.

◆ all_are_same_v< T, Rest... >

template<class T, class... Rest>
bool arene::base::all_are_same_v< T, Rest... > = all_of_v<std::is_same<T, Rest>::value...>
externconstexpr

All the types are the same if more than one type and they are all the same as the first.

◆ all_of_v

template<bool... Args>
bool arene::base::all_of_v = true
externconstexpr

Trait which tests if every value in a parameter pack is true .

Template Parameters
ArgsThe set of boolean values to test
Returns
true if every value in the parameter pack is true , or the parameter pack is empty.
false if any value in the parameter pack is false .

◆ all_of_v< B1, Args... >

template<bool B1, bool... Args>
bool arene::base::all_of_v< B1, Args... > = B1 && all_of_v<Args...>
externconstexpr

Trait which tests if every value in a parameter pack is true .

Template Parameters
ArgsThe set of boolean values to test
Returns
true if every value in the parameter pack is true , or the parameter pack is empty.
false if any value in the parameter pack is false .

◆ always_false_v

template<typename T>
bool arene::base::always_false_v = false
constexpr

A trait which always is false, as a type-dependent expression.

Template Parameters
Thas no impact on the result, but must result in always_false_v<T> being a type-dependent expression.

This is generally used in order to allow having a "fallback" case in a template specialization set which triggers a more meaningful error than "no definition found." Before C++23, the expression static_assert(false,"message") will unconditionally trigger a compiler error, even if the expression is in an uninstantiated template. always_false_v<T> works around this by making the expression type-dependant, like so:

/// @brief Class that must be specialized; the primary template is not intended to be usable
/// @tparam T The template parameter
template <typename T>
struct must_be_specialized {
static_assert(
"No specialization for the input type found. Perhaps you forgot to include a header?"
);
};

◆ any_of_v

template<bool... Args>
bool arene::base::any_of_v = false
externconstexpr

Trait which tests if at least one value in a parameter pack is true .

Template Parameters
ArgsThe set of boolean values to test
Returns
true if any value in the parameter pack is true
false if all values in the parameter pack is false , or the parameter pack is empty.

◆ any_of_v< B1, Args... >

template<bool B1, bool... Args>
bool arene::base::any_of_v< B1, Args... > = B1 || any_of_v<Args...>
externconstexpr

Trait which tests if at least one value in a parameter pack is true .

Template Parameters
ArgsThe set of boolean values to test
Returns
true if any value in the parameter pack is true
false if all values in the parameter pack is false , or the parameter pack is empty.

◆ array< T, 0 >::empty

template<typename T>
std::integral_constant<bool, true> arene::base::array< T, 0 >::empty
constexpr

◆ array< T, 0 >::max_size

template<typename T>
std::integral_constant<std::size_t, 0> arene::base::array< T, 0 >::max_size
constexpr

◆ array< T, 0 >::size

template<typename T>
std::integral_constant<std::size_t, 0> arene::base::array< T, 0 >::size
constexpr

◆ array< T, N >::empty

template<typename T, std::size_t N>
std::integral_constant<bool, false> arene::base::array< T, N >::empty
constexpr

◆ array< T, N >::max_size

template<typename T, std::size_t N>
std::integral_constant<std::size_t, N> arene::base::array< T, N >::max_size
constexpr

◆ array< T, N >::size

template<typename T, std::size_t N>
std::integral_constant<std::size_t, N> arene::base::array< T, N >::size
constexpr

◆ bit_cast

template<class To>
bit_cast_detail::do_bit_cast<To> arene::base::bit_cast {}
externconstexpr

Reinterpret the object representation of one type as that of another.

Template Parameters
Totype to reinterpret as
Fromtype to reinterpret from
Parameters
fromthe source of bits for the return value

Obtain a value of type To by reinterpreting the object representation of From. Every bit in the value representation of the returned To object is equal to the corresponding bit in the object representation of from. The values of padding bits in the returned To object are unspecified.

If there is no value of type To corresponding to the value representation produced, the behavior is undefined. If there are multiple such values, which value is produced is unspecified.

A bit in the value representation of the result is indeterminate if it does not correspond to a bit in the value representation of From (i.e. it corresponds to a padding bit), or corresponds to a bit of an object that is not within its lifetime, or has an indeterminate value. For each bit in the value representation of the result that is indeterminate, the smallest object containing that bit has an indeterminate value; the behavior is undefined unless that object is of unsigned char type. The result does not otherwise contain any indeterminate values.

Returns
An object of type To whose value representation is as described above.
Note
Requires:
bit_cast is usable in a constant expression only when the compiler provides __builtin_bit_cast . Query this via ARENE_IS_ON(ARENE_HAS_CONSTEXPR_BIT_CAST) . On toolchains without the builtin (e.g. GCC 8), bit_cast compiles but cannot appear in a constexpr context.

◆ byte

enum ARENE_MAY_ALIAS arene::base::byte
strong

A type that represents a byte of data.

Use this for cases where you are dealing with serialised data in bytes or inspecting byte-representations of values.

This type is equivalent to std::byte added in C++17.

This type supports only bit-wise operations and does not support arithmetic operations like +, -, *, / or %.

◆ compare_three_way_supported_v

template<typename Lhs, typename Rhs = Lhs, typename = constraints<>>
bool arene::base::compare_three_way_supported_v = false
externconstexpr

Boolean constant indicating if instances of Lhs and Rhs can be compared using compare_three_way.

Template Parameters
LhsThe type of the left-hand operand
RhsThe type of the right-hand operand

◆ compare_three_way_supported_v< Lhs, Rhs, constraints< > >

template<typename Lhs, typename Rhs>
bool arene::base::compare_three_way_supported_v< Lhs, Rhs, constraints< > > = true
externconstexpr

Boolean constant indicating if instances of Lhs and Rhs can be compared using compare_three_way.

Template Parameters
LhsThe type of the left-hand operand
RhsThe type of the right-hand operand

◆ conjunction_v

template<typename... BoolTraits>
bool arene::base::conjunction_v {conjunction<BoolTraits...>::value}
externconstexpr

The combined value of multiple boolean type traits.

Template Parameters
BoolTraitsthe traits to combine
Returns
bool Equivalent to BoolTraits::value && ... .
Note
Evaluation short circuits: If bool(BoolTrait[N]::value) is false , then the remaining BoolTraits::value... are not evaluated.

◆ decays_to_v

template<class T, class U>
bool arene::base::decays_to_v = std::is_same<std::decay_t<T>, U>::value
externconstexpr

Determine if one type decays to be the same as another type.

decays_to_v is useful to emulate deduced-this added in C++23 and for other disambiguation needs in overload sets

constexpr bool decays_to_v
Determine if one type decays to be the same as another type.
Template Parameters
TThe type to decay and compare to U
UThe unqualified type to which the decayed T is compared. U is not modified before the comparison.

◆ default_inline_function_size

std::size_t arene::base::default_inline_function_size {4U * sizeof(void*)}
staticconstexpr

The default size of the buffer used for inline_function .

◆ denotes_nothrow_iterable_range_v

template<typename Iterator, typename Sentinel = Iterator>
bool arene::base::denotes_nothrow_iterable_range_v
externconstexpr
Initial value:
=
denotes_range_detail::denotes_nothrow_iterable_range_v<Iterator, Sentinel>

Check if an iterator/sentinel pair form an iterable range that can be iterated without throwing.

Template Parameters
IteratorThe type to check as an iterator
SentinelThe type to check as a sentinel
Returns
true If the pair satisfies denotes_iterable_range and which cant be iterated without throwing: all of operator++ , operator++(int) , operator* , and operator!= are noexcept .
false otherwise.

◆ denotes_range_v

template<typename Iterator, typename Sentinel = Iterator>
bool arene::base::denotes_range_v
externconstexpr
Initial value:
=
Type trait to detect if an instance of T is copy constructible.
Definition is_copy_constructible.hpp:60
constexpr bool is_iterator_v
Definition iterator_category_traits.hpp:375
constexpr bool is_inequality_comparable_v
remove_cv_t< remove_reference_t< T > > remove_cvref_t
Backport of std::remove_cvref_t.
Definition remove_cvref.hpp:35

Check if an iterator/sentinel pair form an iterable range. The value is true if the pair do form an iterable range, false otherwise.

Template Parameters
IteratorThe type to check as an iterator
SentinelThe type to check as a sentinel

◆ disjunction_v

template<typename... BoolTraits>
bool arene::base::disjunction_v {disjunction<BoolTraits...>::value}
externconstexpr

The combined value of multiple boolean type traits through a logical OR operation.

Template Parameters
BoolTraitsthe traits to combine
Returns
bool Equivalent to BoolTraits::value || ... .
Note
Evaluation short circuits: If BoolTrait[N]::value is true , then the remaining BoolTraits::value... are not evaluated.

◆ forward_like

template<typename From>
auto arene::base::forward_like = forward_like_detail::forward_like<From>{}
externconstexpr

A backport of C++23's std::forward_like @a , it allows forwarding a type with the same reference and const qualifications as another type.

Template Parameters
FromThe type to take the reference and qualification properties from.
ToThe type to apply the reference and qualification properties to.
Parameters
valThe value to apply the reference and qualification properties to.
Returns
A reference of base type To with the following properties:
Note
Mandates
  • From is a referenceable type

◆ hardware_destructive_interference_size

ARENE_MAYBE_UNUSED constexpr std::size_t arene::base::hardware_destructive_interference_size
constexpr
Initial value:
{
compiler_support::detail::l1_cache_line_size
}

The minimum memory spacing required between two items to avoid false-sharing.

Backport of C++17's std::hardware_destructive_interference_size. See P0154R0 for more details

◆ has_fast_inequality_check_v

template<typename T, typename U = T, typename = constraints<>>
bool arene::base::has_fast_inequality_check_v = false
externconstexpr

Type trait to check if an instance of type T can be compared to an instance of type U with a static fast_inequality_check member function that returns inequality_heuristic.

Template Parameters
TThe type of the lhs
UThe type of the rhs. Defaults to T
Returns
true If T::fast_inequality_check(T,U) is defined and returns inequality_heuristic.
false Otherwise.

◆ has_fast_inequality_check_v< T, U, constraints< std::enable_if_t< std::is_same<, inequality_heuristic >::value > > >

template<typename T, typename U>
bool arene::base::has_fast_inequality_check_v< T, U, constraints< std::enable_if_t< std::is_same<, inequality_heuristic >::value > > > = true
externconstexpr

Specialization for the case that T and U can be compared.

◆ has_overloaded_address_operator_v

template<typename T>
bool arene::base::has_overloaded_address_operator_v
externconstexpr
Initial value:
=
has_overloaded_address_operator_detail::has_overloaded_address_operator_for_const_lvalue,
T>)
constexpr bool substitution_succeeds
Determines if a template can be instantiated successfully, similar to C++20's requires clause.

Type trait to check if a type has an overloaded address operator; the value is true if the type has an overloaded address operator, false otherwise.

Template Parameters
TThe type to check

◆ has_selected_unit_v

template<typename Kind, typename = arene::base::constraints<>>
bool arene::base::has_selected_unit_v = false
externconstexpr

Type trait for determining if the given quantity kind has a unit selected. It is true if a unit is selected, false otherwise.

Template Parameters
Kindthe quantity kind to check

◆ has_selected_unit_v< Kind, arene::base::constraints< selected_unit_for_t< Kind > > >

template<typename Kind>
bool arene::base::has_selected_unit_v< Kind, arene::base::constraints< selected_unit_for_t< Kind > > > = true
externconstexpr

Type trait for determining if the given quantity kind has a unit selected. It is true if a unit is selected, false otherwise.

Template Parameters
Kindthe quantity kind to check

◆ in_place

in_place_t arene::base::in_place {}
constexpr

backport of std::in_place from C++17, a tag variable for in-place construction

◆ in_place_index

template<std::size_t I>
in_place_index_t<I> arene::base::in_place_index {}
externconstexpr

backport of std::in_place_index<T> from C++17

◆ in_place_type

template<typename T>
in_place_type_t<T> arene::base::in_place_type {}
externconstexpr

backport of std::in_place_type<T> from C++17

◆ index_of_v

template<typename T, typename... Ts>
auto arene::base::index_of_v = index_of<T, Ts...>::value
externconstexpr

Template meta-function for querying the 0-based index of 'T' within a list of types, 'Ts...'.

The instantiation will be ill-formed if T is not a member of Ts...

Template Parameters
TThe type to search for.
TsThe list of types to search in.

◆ inline_map< Key, Value, Capacity, Compare >::capacity

template<typename Key, typename Value, std::size_t Capacity, typename Compare>
std::integral_constant<typename inline_map<Key, Value, Capacity, Compare>::size_type, Capacity> arene::base::inline_map< Key, Value, Capacity, Compare >::capacity
constexpr

◆ inline_map< Key, Value, Capacity, Compare >::max_size

template<typename Key, typename Value, std::size_t Capacity, typename Compare>
std::integral_constant<typename inline_map<Key, Value, Capacity, Compare>::size_type, Capacity> arene::base::inline_map< Key, Value, Capacity, Compare >::max_size
constexpr

◆ inline_set< T, Capacity, Compare >::capacity

template<typename T, std::size_t Capacity, typename Compare>
std::integral_constant<std::size_t, Capacity> arene::base::inline_set< T, Capacity, Compare >::capacity
constexpr

Externalized initialization of capacity is needed pre C++17.

◆ inline_set< T, Capacity, Compare >::max_size

template<typename T, std::size_t Capacity, typename Compare>
std::integral_constant<std::size_t, Capacity> arene::base::inline_set< T, Capacity, Compare >::max_size
constexpr

Externalized initialization of max_size is needed pre C++17.

◆ inline_string< MaxLength >::npos

template<std::size_t MaxLength>
std::size_t arene::base::inline_string< MaxLength >::npos
constexpr

◆ integer_sequence_contains_v

template<typename Sequence, typename Sequence::value_type Value>
bool arene::base::integer_sequence_contains_v
externconstexpr
Initial value:
=
integer_sequence_ops_detail::integer_sequence_contains(Value, Sequence{})

Checks if the specified integer sequence contains the specified value.

Template Parameters
Sequencethe sequence to search
valuethe value to search for
Precondition
Sequence must be an instantiation of std::integer_sequence.

◆ integer_sequence_count_of_v

template<typename Sequence, typename Sequence::value_type Value>
std::size_t arene::base::integer_sequence_count_of_v = integer_sequence_count_of<Sequence, Value>::value
externconstexpr

Get the number of occurrences of a value in the provided sequence.

Template Parameters
Sequencethe sequence to search
valuethe value to search for
Precondition
Sequence must be an instantiation of std::integer_sequence.

◆ integer_sequence_element_v

template<std::size_t Index, typename Sequence>
auto arene::base::integer_sequence_element_v = integer_sequence_element<Index, Sequence>::value
externconstexpr

The value of the Index th element of a std::integer_sequence.

See also
arene::base::integer_sequence_element
Precondition
Sequence must be an instantiation of std::integer_sequence.

◆ integer_sequence_index_of_v

template<typename Sequence, typename Sequence::value_type Value>
std::size_t arene::base::integer_sequence_index_of_v = integer_sequence_index_of<Sequence, Value>::value
externconstexpr

The index of the first occurrence of a value in a std::integer_sequence.

See also
arene::base::integer_sequence_index_of_v
Precondition
Sequence must be an instantiation of std::integer_sequence.
value must occur in Sequence else compilation will fail.

◆ is_accessor_policy_v

template<class AccessorPolicy>
bool arene::base::is_accessor_policy_v
externconstexpr
Initial value:
=
is_accessor_policy_detail::has_typedefs_and_functions_v<AccessorPolicy> && is_copyable_v<AccessorPolicy> &&
constexpr bool is_nothrow_swappable_v
Trait query indicating if a type can be noexcept-swapped.
constexpr bool is_copyable_v
Backport for the C++20 copyable concept.

Check if a type is a valid accessor policy.

Template Parameters
AccessorPolicyThe policy to check

A type A meets the accessor policy requirements if

  • A has a type alias named element_type
  • A has a type alias named data_handle_type
  • A has a type alias named reference
  • A has a type alias named offset_policy
  • A has a member function named access that takes a data_handle_type and a std::size_t
  • A has a member function named offest that takes a data_handle_type and a std::size_t
  • arene::base::is_copyable_v is true
  • is_nothrow_move_constructible_v is true
  • is_nothrow_move_assignable_v is true
  • is_nothrow_swappable_v is true

◆ is_addable_v

template<typename Lhs, typename Rhs = Lhs>
bool arene::base::is_addable_v = arithmetic_traits_detail::is_addable_v<Lhs, Rhs>
externconstexpr

Check if instances of Lhs can be added to instances of Rhs. The value is true if they can be added, false otherwise.

Template Parameters
LhsThe type of the left-hand operand
RhsThe type of the right-hand operand, defaults to Lhs

◆ is_adl_swappable_v

template<typename T>
bool arene::base::is_adl_swappable_v = substitution_succeeds<swappable_detail::use_adl_swap, T&, T&>
externconstexpr

Trait query if a type has an ADL-discoverable swap function.

Template Parameters
TThe type to test.
Returns
true if an unqualified call to swap(T&,T&) is well-formed.

◆ is_adl_swappable_with_v

template<typename T, typename U>
bool arene::base::is_adl_swappable_with_v
externconstexpr
Initial value:

Trait query if a two types have an ADL-discoverable swap function.

Template Parameters
TThe first type to test.
UThe second type to test.
Returns
If the expressions swap(std::declval<T>(),std::declval<U>()) and swap(std::declval<U>(),std::declval<T>()) are both well-formed in unevaluated context after using std::swap, the value equals true. Otherwise, the value is false.

◆ is_array_convertible_v

template<typename From, typename To>
bool arene::base::is_array_convertible_v
constexpr
Initial value:
=
std::is_convertible<From (*)[], To (*)[]>::value
Type trait to detect if one type is convertible to another.
Definition is_convertible.hpp:171

Type trait to check if a pointer to an array of From is convertible to a pointer to an array of To.

◆ is_base_quantity_kind_of_or_same_as_v

template<typename BaseKind, typename Type>
bool arene::base::is_base_quantity_kind_of_or_same_as_v
externconstexpr
Initial value:
=
constexpr bool is_base_quantity_kind_of_v
Type trait for checking if one type is a base quantity kind for another. Evaluates to true if the fir...

Type trait for checking if one type is a base quantity kind for another, or the same type. Evaluates to true if the first type is the same as the second, or a base quantity kind of the second (the second is a derived quantity kind of the first), false otherwise.

Template Parameters
BaseKindthe base kind
Typethe type to check.

◆ is_base_quantity_kind_of_v

template<typename BaseKind, typename Type>
bool arene::base::is_base_quantity_kind_of_v
externconstexpr
Initial value:
=
is_base_quantity_kind_detail::is_base_quantity_kind_of_v<BaseKind, Type>

Type trait for checking if one type is a base quantity kind for another. Evaluates to true if the first type is a base quantity kind of the second (the second is a derived quantity kind of the first), false otherwise.

Note: a quantity kind is not considered to be a base quantity for itself, so is_base_quantity_kind_of_v<T,T> will always be false, for all types T

Template Parameters
BaseKindthe base kind
Typethe type to check.

◆ is_bidirectional_iterator_v

template<typename T, typename = constraints<>>
bool arene::base::is_bidirectional_iterator_v = false
constexpr

Type trait to check if a type is a bidirectional iterator The value is true if the type meets the requirements, false otherwise.

Template Parameters
TThe type being checked

◆ is_bidirectional_iterator_v< T, constraints< std::enable_if_t< is_forward_iterator_v< T > >, std::enable_if_t< std::is_base_of< std::bidirectional_iterator_tag, typename std::iterator_traits< T >::iterator_category >::value >, std::enable_if_t< std::is_same< T &, >::value >, std::enable_if_t< std::is_same< T, >::value > > >

template<typename T>
bool arene::base::is_bidirectional_iterator_v< T, constraints< std::enable_if_t< is_forward_iterator_v< T > >, std::enable_if_t< std::is_base_of< std::bidirectional_iterator_tag, typename std::iterator_traits< T >::iterator_category >::value >, std::enable_if_t< std::is_same< T &, >::value >, std::enable_if_t< std::is_same< T, >::value > > > = true
constexpr

Specialization for types that meet the syntactic requirements for a bidirectional iterator

Template Parameters
TThe type being checked

◆ is_binary_predicate_v

template<class F, class T1, class T2 = T1>
bool arene::base::is_binary_predicate_v
externconstexpr
Initial value:
=
F,
remove_cvref_t<T2> const&> &&
Type trait to detect if an instance of T is move constructible.
Definition is_move_constructible.hpp:59
constexpr bool is_predicate_v
backport for the C++20 predicate concept

determines if a type satisfies the BinaryPredicate named requirement

Template Parameters
Fthe possible binary predicate function object
T1type of the first argument
T2type of the second argument

BinaryPredicate is a set of requirements expected by some of the standard library facilities from the user-provided function object types.

Given a BinaryPredicate pred and a pair of iterators iter1 and iter2 or an iterator iter and a (possibly const) value value, the type and value category of the expression pred(*iter1, *iter2) or, respectively, pred(*iter, value) , must meet the BooleanTestable requirements.

In addition, evaluation of that expression is not allowed to call non-const member functions of the dereferenced iterators; syntactically, the predicate must accept const object arguments, with the same behavior regardless of whether its arguments are const or non-const.

A type satisfies BinaryPredicate if

  • the type satisfies Predicate
  • the type satisfies CopyConstructible

◆ is_compare_v

template<class F, class T1, class T2 = T1>
bool arene::base::is_compare_v
externconstexpr
Initial value:
=
is_compare_detail::is_equiv_valid_v<F, T1, T2>
constexpr bool is_binary_predicate_v
determines if a type satisfies the BinaryPredicate named requirement

determines if a type satisfies the Compare named requirement

Template Parameters
Fthe possible compare function object
T1type of the first argument
T2type of the second argument

Compare is a set of requirements expected by some of the standard library facilities from the user-provided function object types.

The return value of the function call operation applied to an object of a type satisfying Compare, when converted to bool, yields true if the first argument of the call appears before the second in the strict weak ordering relation induced by this type, and false otherwise.

As with any BinaryPredicate, evaluation of that expression is not allowed to call non-const functions through the dereferenced iterators and, syntactically, the function call operation must accept const object arguments, with the same behavior regardless of whether the arguments are const or non-const.

A type satisfies Compare if

  • the type satisfies BinaryPredicate and Given comp, an object of type F and equiv(a, b) , an expression-equivalent to !comp(a, b) && !comp(b, a) , the following expressions must be valid and have their specified effects:
  • comp(a, b) establishes a strict weak ordering
  • equiv(a, b) establishes an equivalence relationship

◆ is_copyable_v

template<class T, class = arene::base::constraints<>>
bool arene::base::is_copyable_v = false
externconstexpr

Backport for the C++20 copyable concept.

Template Parameters
TThe type to test

The concept copyable<T> specifies that T is a movable object type that can also be copied (that is, it supports copy construction and copy assignment).

◆ is_copyable_v< T, arene::base::constraints< std::enable_if_t< std::is_object< T >::value > > >

template<class T>
bool arene::base::is_copyable_v< T, arene::base::constraints< std::enable_if_t< std::is_object< T >::value > > >
externconstexpr
Initial value:

Backport for the C++20 copyable concept.

Template Parameters
TThe type to test

The concept copyable<T> specifies that T is a movable object type that can also be copied (that is, it supports copy construction and copy assignment).

◆ is_default_swappable_v

template<typename T>
bool arene::base::is_default_swappable_v
externconstexpr
Initial value:

Trait query if a type can be swapped via the default implementation.

Template Parameters
TThe type to test.
Returns
true if std::is_move_assignable<T> and std::is_move_constructible<T> are true.

◆ is_double_ended

template<typename TypeParam>
bool arene::base::is_double_ended = !TypeParam::wrapping_allowed
constexpr

Type trait to see if a particular TypeParam is double-ended or not; used to exclude some tests.

Template Parameters
TypeParamThe queue/deque type to check
Note
This implementation works kind of by coincidence, because currently the only queue with wrapping allowed happens to be single-ended. There's no inherent relationship between wrapping being allowed and being double-ended.

◆ is_equality_comparable_v

template<typename T, typename U = T, typename = constraints<>>
bool arene::base::is_equality_comparable_v = false
externconstexpr

Type trait to check if an instance of type T can be compared to an instance of type U with the equality operator.

Template Parameters
TThe type of the lhs
UThe type of the rhs. Defaults to T
Returns
true if an instance of T can be compared with an instance of U, false otherwise.

◆ is_equality_comparable_v< T, U, constraints< std::enable_if_t< std::is_convertible<, bool >::value > > >

template<typename T, typename U>
bool arene::base::is_equality_comparable_v< T, U, constraints< std::enable_if_t< std::is_convertible<, bool >::value > > >
externconstexpr
Initial value:
=
true

Specialization for the case that T and U can be compared.

◆ is_extents_v

template<typename T>
bool arene::base::is_extents_v = false
externconstexpr

Helper variable to check if a provided type is an instantiation of extents.

The value is true if the type is an instantiation of extents, false otherwise

Template Parameters
TThe type to check

◆ is_extents_v< extents< IndexType, Extents... > >

template<typename IndexType, std::size_t... Extents>
bool arene::base::is_extents_v< extents< IndexType, Extents... > > = true
externconstexpr

Helper variable to check if a provided type is an instantiation of extents.

The value is true if the type is an instantiation of extents, false otherwise

Template Parameters
IndexTypethe index type
Extentssequence of static extents

◆ is_forward_iterator_v

template<typename T, typename = constraints<>>
bool arene::base::is_forward_iterator_v = false
constexpr

Type trait to check if a type is a forward iterator The value is true if the type meets the requirements, false otherwise.

Template Parameters
TThe type being checked

◆ is_forward_iterator_v< T, constraints< std::enable_if_t< is_input_iterator_v< T > >, std::enable_if_t< std::is_base_of< std::forward_iterator_tag, typename std::iterator_traits< T >::iterator_category >::value >, std::enable_if_t< std::is_default_constructible< T >::value >, std::enable_if_t< std::is_same< T, >::value >, std::enable_if_t< std::is_reference< typename std::iterator_traits< T >::reference >::value >, std::enable_if_t< std::is_same< remove_cvref_t< typename std::iterator_traits< T >::value_type >, remove_cvref_t< typename std::iterator_traits< T >::reference > >::value > > >

template<typename T>
bool arene::base::is_forward_iterator_v< T, constraints< std::enable_if_t< is_input_iterator_v< T > >, std::enable_if_t< std::is_base_of< std::forward_iterator_tag, typename std::iterator_traits< T >::iterator_category >::value >, std::enable_if_t< std::is_default_constructible< T >::value >, std::enable_if_t< std::is_same< T, >::value >, std::enable_if_t< std::is_reference< typename std::iterator_traits< T >::reference >::value >, std::enable_if_t< std::is_same< remove_cvref_t< typename std::iterator_traits< T >::value_type >, remove_cvref_t< typename std::iterator_traits< T >::reference > >::value > > > = true
constexpr

Specialization for types that meet the input iterator requirements

Template Parameters
TThe type being checked

◆ is_greater_than_comparable_v

template<typename T, typename U = T, typename = constraints<>>
bool arene::base::is_greater_than_comparable_v = false
externconstexpr

Type trait to check if an instance of type T can be compared to an instance of type U with the greater-than operator.

Template Parameters
TThe type of the lhs
UThe type of the rhs. Defaults to T
Returns
true if an instance of T can be compared with an instance of U, false otherwise.

◆ is_greater_than_comparable_v< T, U, constraints< std::enable_if_t< std::is_convertible<, bool >::value > > >

template<typename T, typename U>
bool arene::base::is_greater_than_comparable_v< T, U, constraints< std::enable_if_t< std::is_convertible<, bool >::value > > >
externconstexpr
Initial value:
=
true

Specialization for the case that T and U can be compared.

◆ is_greater_than_or_equal_comparable_v

template<typename T, typename U = T, typename = constraints<>>
bool arene::base::is_greater_than_or_equal_comparable_v = false
externconstexpr

Type trait to check if an instance of type T can be compared to an instance of type U with the greater-than-or-equal operator.

Template Parameters
TThe type of the lhs
UThe type of the rhs. Defaults to T
Returns
true if an instance of T can be compared with an instance of U, false otherwise.

◆ is_greater_than_or_equal_comparable_v< T, U, constraints< std::enable_if_t< std::is_convertible<, bool >::value > > >

template<typename T, typename U>
bool arene::base::is_greater_than_or_equal_comparable_v< T, U, constraints< std::enable_if_t< std::is_convertible<, bool >::value > > >
externconstexpr
Initial value:
=
true

Specialization for the case that T and U can be compared.

◆ is_implicitly_constructible_v

template<class T, class... Args>
bool arene::base::is_implicitly_constructible_v = is_implicitly_constructible<T, Args...>::value
externconstexpr

Type trait to detect if a type is implicitly constructible from arguments of the specified types.

Template Parameters
TThe type to check if it can be implicitly constructed.
ArgsThe arguments to try to implicitly construct with.

◆ is_inequality_comparable_v

template<typename T, typename U = T, typename = constraints<>>
bool arene::base::is_inequality_comparable_v = false
externconstexpr

Type trait to check if an instance of type T can be compared to an instance of type U with the inequality operator.

Template Parameters
TThe type of the lhs
UThe type of the rhs. Defaults to T
Returns
true if an instance of T can be compared with an instance of U, false otherwise.

◆ is_inequality_comparable_v< T, U, constraints< std::enable_if_t< std::is_convertible<, bool >::value > > >

template<typename T, typename U>
bool arene::base::is_inequality_comparable_v< T, U, constraints< std::enable_if_t< std::is_convertible<, bool >::value > > >
externconstexpr
Initial value:
=
true

Specialization for the case that T and U can be compared.

◆ is_inline_buffer_string_v

template<typename Type>
bool arene::base::is_inline_buffer_string_v = is_inline_string_v<Type>
externconstexpr

Trait to query if a type is an inline_string.

Template Parameters
TypeThe type to check.

true if Type is a cv-qualified instantiation of inline_string. Otherwise, false.

◆ is_inline_string_v

template<typename Type>
bool arene::base::is_inline_string_v = inline_string_detail::is_inline_string_v<std::remove_cv_t<Type>>
externconstexpr

Trait to query if a type is an inline_string.

Template Parameters
TypeThe type to check.

true if Type is a cv-qualified instantiation of inline_string. Otherwise, false.

◆ is_input_iterator_v

template<typename T, typename = constraints<>>
bool arene::base::is_input_iterator_v = false
constexpr

Type trait to check if a type is an input iterator The value is true if the type meets the requirements, false otherwise.

Template Parameters
TThe type being checked

◆ is_input_iterator_v< T, constraints< std::enable_if_t< iterator_category_detail::is_basic_iterator_v< T > >, typename std::iterator_traits< T >::reference &&, typename std::iterator_traits< T >::value_type &, std::enable_if_t< std::is_base_of< std::input_iterator_tag, typename std::iterator_traits< T >::iterator_category >::value >, std::enable_if_t< is_equality_comparable_v< T > >, std::enable_if_t< is_inequality_comparable_v< T > >, std::enable_if_t< std::is_integral< typename std::iterator_traits< T >::difference_type >::value >, std::enable_if_t< std::is_signed< typename std::iterator_traits< T >::difference_type >::value >, std::enable_if_t< std::is_same<, typename std::iterator_traits< T >::reference >::value >, std::enable_if_t< iterator_category_detail::have_common_type_v< typename std::iterator_traits< T >::reference &&, typename std::iterator_traits< T >::value_type & > >, std::enable_if_t< iterator_category_detail::have_common_type_v< &&, typename std::iterator_traits< T >::value_type & > >, std::enable_if_t< iterator_category_detail::has_valid_pointer_trait_v< T > > > >

template<typename T>
bool arene::base::is_input_iterator_v< T, constraints< std::enable_if_t< iterator_category_detail::is_basic_iterator_v< T > >, typename std::iterator_traits< T >::reference &&, typename std::iterator_traits< T >::value_type &, std::enable_if_t< std::is_base_of< std::input_iterator_tag, typename std::iterator_traits< T >::iterator_category >::value >, std::enable_if_t< is_equality_comparable_v< T > >, std::enable_if_t< is_inequality_comparable_v< T > >, std::enable_if_t< std::is_integral< typename std::iterator_traits< T >::difference_type >::value >, std::enable_if_t< std::is_signed< typename std::iterator_traits< T >::difference_type >::value >, std::enable_if_t< std::is_same<, typename std::iterator_traits< T >::reference >::value >, std::enable_if_t< iterator_category_detail::have_common_type_v< typename std::iterator_traits< T >::reference &&, typename std::iterator_traits< T >::value_type & > >, std::enable_if_t< iterator_category_detail::have_common_type_v< &&, typename std::iterator_traits< T >::value_type & > >, std::enable_if_t< iterator_category_detail::has_valid_pointer_trait_v< T > > > > = true
constexpr

Specialization for types that meet the syntactic input iterator requirements

Template Parameters
TThe type being checked

◆ is_instantiation_of_v

template<class Type, template< class... > class Template>
bool arene::base::is_instantiation_of_v = false
constexpr

true iff Type is an instantiation of Template

Note
The default definition is always false. See specialization below.

◆ is_instantiation_of_v< Template< P... >, Template >

template<class... P, template< class... > class Template>
bool arene::base::is_instantiation_of_v< Template< P... >, Template > = true
constexpr

true iff Type is an instantiation of Template

Note
This specialization is always true.

◆ is_integral_constant_like_v

template<class T>
bool arene::base::is_integral_constant_like_v = is_integral_constant_like_detail::is_integral_constant_like_v<T>
externconstexpr

Backport for the C++26 exposition-only integral-constant-like concept.

Template Parameters
TThe type to test

The concept integral-constant-like<T> specifies that all of the following are true:

  • is_integral_v<remove_cvref_t<decltype(T::value)>>
  • !is_same_v<bool, remove_cvref_t<decltype(T::value)>>
  • convertible_to<T, decltype(T::value)>
  • equality_comparable_with<T, decltype(T::value)>
  • bool_constant<T() == T::value>::value
  • bool_constant<static_cast<decltype(T::value)>(T()) == T::value>::value

◆ is_invocable_r_v

template<typename Ret, typename Fn, typename... Args>
bool arene::base::is_invocable_r_v = is_invocable_r<Ret, Fn, Args...>::value
externconstexpr

Determine if a functor type is invocable with the specified return and argument types.

Trait to determine if a given type is a transparent comparator for a given set of operands.

Template Parameters
RetThe functor return type.
FnThe functor type.
ArgsThe functor parameter types.
CThe type to test
TThe type of the left hand operand
UThe type of the right hand operand

◆ is_invocable_v

template<typename Fn, typename... Args>
bool arene::base::is_invocable_v = is_invocable<Fn, Args...>::value
externconstexpr

Determine if a functor type is invocable with the specified argument types.

Template Parameters
FnThe functor type.
ArgsThe functor parameter types.

◆ is_iterator_v

template<typename T>
bool arene::base::is_iterator_v
constexpr
Initial value:
=
is_input_iterator_v<T> || (iterator_category_detail::has_output_iterator_category_v<T> && is_output_iterator_v<T>)
constexpr bool is_output_iterator_v
Definition iterator_category_traits.hpp:245
constexpr bool is_input_iterator_v
Definition iterator_category_traits.hpp:259

Type trait for checking if a type is an iterator. The value is true if the type meets the requirements, false otherwise.

Template Parameters
TThe type being checked

◆ is_layout_mapping_policy_v

template<typename T>
bool arene::base::is_layout_mapping_policy_v = is_layout_mapping_detail::is_layout_mapping_policy_v<T>
externconstexpr

Helper trait to check if T is a valid layout mapping policy.

A valid layout mapping policy must have a template member mapping such that T::mapping<some_extent> is a valid layout mapping, such that T::mapping<some_extent>::extents_type is some_extent and T::mapping<some_extent>::layout_type is T

The value is true if T has all these properties, false otherwise

Template Parameters
TThe type being checked

◆ is_layout_mapping_v

template<typename T>
bool arene::base::is_layout_mapping_v = is_layout_mapping_detail::is_layout_mapping_v<T>
externconstexpr

Helper trait to indicate if the given type has all the basic properties required of a layout mapping:

  • It must be copy constructible, and copy assignable
  • It must be nothrow-move-constructible and nothrow-move-assignable
  • It must be nothrow-swappable
  • It must be equality comparable
  • It must have the type aliases:
    • T::extents_type must be an instance of extents
    • T::index_type must be an alias for T::extents_type::index_type
    • T::rank_type must be an alias for T::extents_type::rank_type
    • T::layout_type must be a valid layout mapping policy for T such that T::layout_type::mapping<T::extents_type> is T
  • It must have the const member functions:
    • extents() must return an instance of T::extents_type
    • required_span_size() must return an instance of T::index_type
    • is_unique() must return bool
    • is_exhaustive() must return bool
    • is_strided() must return bool
  • It must have the static member functions:
    • is_always_unique() must return bool
    • is_always_exhaustive() must return bool
    • is_always_strided() must return bool
  • It must be invocable with T::extents_type::rank() indices of type T::index_type returning an instance of T::index_type

The value is true if T has all these properties, false otherwise

Template Parameters
TThe type being checked

◆ is_layout_mapping_v< layout_stride::mapping< Extents > >

template<typename Extents>
bool arene::base::is_layout_mapping_v< layout_stride::mapping< Extents > > = true
externconstexpr

Specialization of is_layout_mapping_v to break a recursive cycle in the layout_stride equality operator.

Template Parameters
ExtentsAny specialization of arene::base::extents

◆ is_less_than_comparable_v

template<typename T, typename U = T, typename = constraints<>>
bool arene::base::is_less_than_comparable_v = false
externconstexpr

Type trait to check if an instance of type T can be compared to an instance of type U with the less-than operator.

Template Parameters
TThe type of the lhs
UThe type of the rhs. Defaults to T
Returns
true if an instance of T can be compared with an instance of U, false otherwise.

◆ is_less_than_comparable_v< T, U, constraints< std::enable_if_t< std::is_convertible<, bool >::value > > >

template<typename T, typename U>
bool arene::base::is_less_than_comparable_v< T, U, constraints< std::enable_if_t< std::is_convertible<, bool >::value > > >
externconstexpr
Initial value:
=
true

Specialization for the case that T and U can be compared.

◆ is_less_than_or_equal_comparable_v

template<typename T, typename U = T, typename = constraints<>>
bool arene::base::is_less_than_or_equal_comparable_v = false
externconstexpr

Type trait to check if an instance of type T can be compared to an instance of type U with the less-than-or-equal operator.

Template Parameters
TThe type of the lhs
UThe type of the rhs. Defaults to T
Returns
true if an instance of T can be compared with an instance of U, false otherwise.

◆ is_less_than_or_equal_comparable_v< T, U, constraints< std::enable_if_t< std::is_convertible<, bool >::value > > >

template<typename T, typename U>
bool arene::base::is_less_than_or_equal_comparable_v< T, U, constraints< std::enable_if_t< std::is_convertible<, bool >::value > > >
externconstexpr
Initial value:
=
true

Specialization for the case that T and U can be compared.

◆ is_mdspan_v

template<typename T>
bool arene::base::is_mdspan_v {is_mdspan_detail::is_mdspan_v<std::remove_cv_t<T>>}
externconstexpr

Type trait to determine if the given type is an mdspan of some kind.

Template Parameters
TThe type to check

◆ is_movable_v

template<class T, class = arene::base::constraints<>>
bool arene::base::is_movable_v = false
externconstexpr

Backport for the C++20 movable concept.

Template Parameters
TThe type to test

The concept movable<T> specifies that T is an object type that can be moved (that is, it can be move constructed, move assigned, and lvalues of type T can be swapped).

◆ is_movable_v< T, arene::base::constraints< std::enable_if_t< std::is_object< T >::value > > >

template<class T>
bool arene::base::is_movable_v< T, arene::base::constraints< std::enable_if_t< std::is_object< T >::value > > >
externconstexpr
Initial value:
=
constexpr bool is_swappable_v
Trait query indicating if a type can be swapped.

Backport for the C++20 movable concept.

Template Parameters
TThe type to test

The concept movable<T> specifies that T is an object type that can be moved (that is, it can be move constructed, move assigned, and lvalues of type T can be swapped).

◆ is_noexcept_part_of_function_type_v

template<typename Dummy>
bool arene::base::is_noexcept_part_of_function_type_v {ARENE_NOEXCEPT_IS_PART_OF_FUNCTION_TYPE}
externconstexpr

Used to check if the noexcept specifier is considered part of a function's type. In C++14 and earlier noexcept was not considered as part of a function type. However, in C++17 and later noexcept is part of a function type. An example:

auto without_noexcept() -> void;

auto with_noexcept() noexcept -> void;

bool types_match = std::is_same<decltype(&without_noexcept), decltype(&with_noexcept)>::value;

In C++14 and earlier types_match will be true because both types will be void (*)(). In C++17 and later types_match will be false because the second type will be void (*)() noexcept.

This value is templated on a Dummy type in order for it to operate with SFINAE. Use as: std::enable_if_t<is_noexcept_part_of_function_type_v<T>>

Template Parameters
DummyAn unused type for SFINAE compatibility

◆ is_non_null_v

template<typename T>
bool arene::base::is_non_null_v = is_instantiation_of_v<remove_cvref_t<T>, non_null>
constexpr

Trait that deduces if a type is an non_null to any type.

The test is after removing const and reference qualification

Template Parameters
TThe type to test if it is a non_null

◆ is_non_owning_ptr_v

template<typename T>
bool arene::base::is_non_owning_ptr_v = is_instantiation_of_v<std::remove_const_t<T>, non_owning_ptr>
constexpr

Trait that deduces if a type is an non_owning_ptr to any type.

The test is after removing const and reference qualification

Template Parameters
TThe type to test if it is a non_owning_ptr

◆ is_nothrow_addable_v

template<typename Lhs, typename Rhs = Lhs>
bool arene::base::is_nothrow_addable_v = arithmetic_traits_detail::is_nothrow_addable_v<Lhs, Rhs>
externconstexpr

Check if instances of Lhs can be added to instances of Rhs without throwing an exception. The value is true if they can be added without throwing, false otherwise.

Template Parameters
LhsThe type of the left-hand operand
RhsThe type of the right-hand operand, defaults to Lhs

◆ is_nothrow_adl_swappable_v

template<typename T, bool = is_adl_swappable_v<T>>
bool arene::base::is_nothrow_adl_swappable_v = is_nothrow_adl_swappable_with_v<T&, T&>
externconstexpr

Trait query if a type has a noexcept ADL-discoverable swap function.

Template Parameters
TThe type to test.
Returns
true if an unqualified call to swap(T&,T&) is well-formed and it is marked noexcept .

◆ is_nothrow_adl_swappable_with_v

template<typename T, typename U, bool = is_adl_swappable_with_v<T, U>>
bool arene::base::is_nothrow_adl_swappable_with_v = false
externconstexpr

Trait query if two types have a noexcept ADL-discoverable swap function.

Template Parameters
TThe first type to test.
UThe second type to test.
Returns
If the expressions swap(std::declval<T>(),std::declval<U>()) and swap(std::declval<U>(),std::declval<T>()) are both well-formed in unevaluated context after using std::swap and are marked noexcept, the value equals true. Otherwise, the value is false.

◆ is_nothrow_adl_swappable_with_v< T, U, true >

template<typename T, typename U>
bool arene::base::is_nothrow_adl_swappable_with_v< T, U, true >
externconstexpr
Initial value:
=
static ARENE_MAYBE_UNUSED constexpr auto const & swap
A Customization Point Object implementation of the constexpr compatible std::swap from C++17.
Definition swap.hpp:136
auto declval() noexcept -> T &&
A dummy function that is declared but not defined, with a user-specified return type,...

Trait query if two types have a noexcept ADL-discoverable swap function.

Template Parameters
TThe first type to test.
UThe second type to test.
Returns
If the expressions swap(std::declval<T>(),std::declval<U>()) and swap(std::declval<U>(),std::declval<T>()) are both well-formed in unevaluated context after using std::swap and are marked noexcept, the value equals true. Otherwise, the value is false.

◆ is_nothrow_default_swappable_v

template<typename T>
bool arene::base::is_nothrow_default_swappable_v
externconstexpr
Initial value:

Trait query if a type can be noexcept swapped the default implementation.

Template Parameters
TThe type to test.
Returns
true if std::is_nothrow_move_assignable<T> and std::is_nothrow_move_constructible<T> are true.

◆ is_nothrow_equality_comparable_v

template<typename T, typename U = T, typename = constraints<>>
bool arene::base::is_nothrow_equality_comparable_v = false
externconstexpr

Type trait to check if an instance of type T can be compared to an instance of type U with the equality operator without throwing an exception.

Template Parameters
TThe type of the lhs
UThe type of the rhs. Defaults to T
Returns
true if an instance of T can be compared with an instance of U without throwing, false otherwise.

◆ is_nothrow_equality_comparable_v< T, U, constraints< std::enable_if_t< is_equality_comparable_v< T, U > > > >

template<typename T, typename U>
bool arene::base::is_nothrow_equality_comparable_v< T, U, constraints< std::enable_if_t< is_equality_comparable_v< T, U > > > >
externconstexpr
Initial value:
=

Specialization for the case that T and U can be compared.

◆ is_nothrow_greater_than_comparable_v

template<typename T, typename U = T, typename = constraints<>>
bool arene::base::is_nothrow_greater_than_comparable_v = false
externconstexpr

Type trait to check if an instance of type T can be compared to an instance of type U with the greater-than operator without throwing an exception.

Template Parameters
TThe type of the lhs
UThe type of the rhs. Defaults to T
Returns
true if an instance of T can be compared with an instance of U without throwing, false otherwise.

◆ is_nothrow_greater_than_comparable_v< T, U, constraints< std::enable_if_t< is_greater_than_comparable_v< T, U > > > >

template<typename T, typename U>
bool arene::base::is_nothrow_greater_than_comparable_v< T, U, constraints< std::enable_if_t< is_greater_than_comparable_v< T, U > > > >
externconstexpr
Initial value:
=

Specialization for the case that T and U can be compared.

◆ is_nothrow_greater_than_or_equal_comparable_v

template<typename T, typename U = T, typename = constraints<>>
bool arene::base::is_nothrow_greater_than_or_equal_comparable_v = false
externconstexpr

Type trait to check if an instance of type T can be compared to an instance of type U with the greater-than-or-equal operator without throwing an exception.

Template Parameters
TThe type of the lhs
UThe type of the rhs. Defaults to T
Returns
true if an instance of T can be compared with an instance of U without throwing, false otherwise.

◆ is_nothrow_greater_than_or_equal_comparable_v< T, U, constraints< std::enable_if_t< is_greater_than_or_equal_comparable_v< T, U > > > >

template<typename T, typename U>
bool arene::base::is_nothrow_greater_than_or_equal_comparable_v< T, U, constraints< std::enable_if_t< is_greater_than_or_equal_comparable_v< T, U > > > >
externconstexpr
Initial value:
=

Specialization for the case that T and U can be compared.

◆ is_nothrow_implicitly_constructible_v

template<class T, class... Args>
bool arene::base::is_nothrow_implicitly_constructible_v = is_nothrow_implicitly_constructible<T, Args...>::value
externconstexpr

Type trait to detect if a type is nothrow implicitly constructible from arguments of the specified types.

Template Parameters
TThe type to check if it can be nothrow implicitly constructed.
ArgsThe arguments to try to nothrow implicitly construct with.

◆ is_nothrow_inequality_comparable_v

template<typename T, typename U = T, typename = constraints<>>
bool arene::base::is_nothrow_inequality_comparable_v = false
externconstexpr

Type trait to check if an instance of type T can be compared to an instance of type U with the inequality operator without throwing an exception.

Template Parameters
TThe type of the lhs
UThe type of the rhs. Defaults to T
Returns
true if an instance of T can be compared with an instance of U without throwing, false otherwise.

◆ is_nothrow_inequality_comparable_v< T, U, constraints< std::enable_if_t< is_inequality_comparable_v< T, U > > > >

template<typename T, typename U>
bool arene::base::is_nothrow_inequality_comparable_v< T, U, constraints< std::enable_if_t< is_inequality_comparable_v< T, U > > > >
externconstexpr
Initial value:
=

Specialization for the case that T and U can be compared.

◆ is_nothrow_invocable_r_v

template<typename Ret, typename Fn, typename... Args>
bool arene::base::is_nothrow_invocable_r_v = is_nothrow_invocable_r<Ret, Fn, Args...>::value
externconstexpr

Determine if a functor type is no-throw invocable with the specified return and argument types.

Template Parameters
RetThe functor return type.
FnThe functor type.
ArgsThe functor parameter types.

◆ is_nothrow_invocable_v

template<typename Fn, typename... Args>
bool arene::base::is_nothrow_invocable_v = is_nothrow_invocable<Fn, Args...>::value
externconstexpr

Determine if a functor type is no-throw invocable with the specified argument types.

Template Parameters
FnThe functor type.
ArgsThe functor parameter types.

◆ is_nothrow_less_than_comparable_v

template<typename T, typename U = T, typename = constraints<>>
bool arene::base::is_nothrow_less_than_comparable_v = false
externconstexpr

Type trait to check if an instance of type T can be compared to an instance of type U with the less-than operator without throwing an exception.

Template Parameters
TThe type of the lhs
UThe type of the rhs. Defaults to T
Returns
true if an instance of T can be compared with an instance of U without throwing, false otherwise.

◆ is_nothrow_less_than_comparable_v< T, U, constraints< std::enable_if_t< is_less_than_comparable_v< T, U > > > >

template<typename T, typename U>
bool arene::base::is_nothrow_less_than_comparable_v< T, U, constraints< std::enable_if_t< is_less_than_comparable_v< T, U > > > >
externconstexpr
Initial value:
=

Specialization for the case that T and U can be compared.

◆ is_nothrow_less_than_or_equal_comparable_v

template<typename T, typename U = T, typename = constraints<>>
bool arene::base::is_nothrow_less_than_or_equal_comparable_v = false
externconstexpr

Type trait to check if an instance of type T can be compared to an instance of type U with the less-than-or-equal operator without throwing an exception.

Template Parameters
TThe type of the lhs
UThe type of the rhs. Defaults to T
Returns
true if an instance of T can be compared with an instance of U without throwing, false otherwise.

◆ is_nothrow_less_than_or_equal_comparable_v< T, U, constraints< std::enable_if_t< is_less_than_or_equal_comparable_v< T, U > > > >

template<typename T, typename U>
bool arene::base::is_nothrow_less_than_or_equal_comparable_v< T, U, constraints< std::enable_if_t< is_less_than_or_equal_comparable_v< T, U > > > >
externconstexpr
Initial value:
=

Specialization for the case that T and U can be compared.

◆ is_nothrow_only_explicitly_constructible_v

template<class T, class... Args>
bool arene::base::is_nothrow_only_explicitly_constructible_v
externconstexpr
Initial value:
=
Type trait to detect if a type is constructible from arguments of the specified types and is noexcept...
Definition is_constructible.hpp:84
constexpr bool is_nothrow_implicitly_constructible_v
Type trait to detect if a type is nothrow implicitly constructible from arguments of the specified ty...

Type trait to detect if a type is nothrow explicitly constructible from arguments of the specified types.

Template Parameters
TThe type to check if it can be nothrow explicitly constructed.
ArgsThe arguments to try to nothrow explicitly construct with.

◆ is_nothrow_subtractable_v

template<typename Lhs, typename Rhs = Lhs>
bool arene::base::is_nothrow_subtractable_v = arithmetic_traits_detail::is_nothrow_subtractable_v<Lhs, Rhs>
externconstexpr

Check if instances of Rhs can be subtracted from an instance of Lhs without throwing an exception. The value is true if they can be added without throwing, false otherwise.

Template Parameters
LhsThe type of the left-hand operand
RhsThe type of the right-hand operand, defaults to Lhs

◆ is_nothrow_swappable_v

template<typename T>
bool arene::base::is_nothrow_swappable_v = is_nothrow_swappable_with_v<T&, T&>
externconstexpr

Trait query indicating if a type can be noexcept-swapped.

Template Parameters
Tthe type to test
Returns
is_nothrow_swappable_with_v<T&, T&>

◆ is_nothrow_swappable_with_v

template<typename T, typename U>
bool arene::base::is_nothrow_swappable_with_v
externconstexpr
Initial value:
=
constexpr bool is_adl_swappable_v
Trait query if a type has an ADL-discoverable swap function.
constexpr bool is_nothrow_default_swappable_v
Trait query if a type can be noexcept swapped the default implementation.
constexpr bool is_nothrow_adl_swappable_with_v
Trait query if two types have a noexcept ADL-discoverable swap function.

Trait query indicating if two types can be noexcept-swapped.

Template Parameters
Tthe first type to test
Uthe second type to test
Returns
If the expressions swap(std::declval<T>(),std::declval<U>()) and swap(std::declval<U>(),std::declval<T>()) are both well-formed in unevaluated context after using std::swap and are marked noexcept, the value equals true. Otherwise, the value is false.

◆ is_one_of_v

template<typename T, typename... Ts>
bool arene::base::is_one_of_v = any_of_v<std::is_same<T, Ts>::value...>
constexpr

Query if the type 'T' is one of the list of types 'Ts...'.

Evaluates to 'true' if 'T' is a member of the set 'Ts...', otherwise to 'false'.

Template Parameters
TThe type to search for in TL.
TLThe TypeList to search in for T.

◆ is_only_explicitly_constructible_v

template<class T, class... Args>
bool arene::base::is_only_explicitly_constructible_v
externconstexpr
Initial value:
=
std::is_constructible<T, Args...>::value && !is_implicitly_constructible_v<T, Args...>
Type trait to detect if a type is constructible from arguments of the specified types.
Definition is_constructible.hpp:29

Type trait to detect if a type is explicitly constructible from arguments of the specified types.

Template Parameters
TThe type to check if it can be explicitly constructed.
ArgsThe arguments to try to explicitly construct with.

◆ is_output_iterator_v

template<typename T, typename = constraints<>>
bool arene::base::is_output_iterator_v = false
constexpr

Type trait to check if a type is an output iterator The value is true if the type meets the requirements, false otherwise.

Template Parameters
TThe type being checked

◆ is_output_iterator_v< T, constraints< std::enable_if_t< iterator_category_detail::is_basic_iterator_v< T > > > >

template<typename T>
bool arene::base::is_output_iterator_v< T, constraints< std::enable_if_t< iterator_category_detail::is_basic_iterator_v< T > > > >
constexpr
Initial value:
=
iterator_category_detail::has_output_iterator_category_v<T> ||
Type trait to detect if an instance of To is assignable to from arguments of From.
Definition is_assignable.hpp:47

Specialization for types that meet the basic iterator requirements

Template Parameters
TThe type being checked

◆ is_pair_like_v

template<typename T, typename = constraints<>>
bool arene::base::is_pair_like_v = false
externconstexpr

Type trait to check if a type implements the tuple protocol and has a std::tuple_size of 2.

Template Parameters
TThe type to check

◆ is_pair_like_v< T, constraints< std::enable_if_t< std::tuple_size< remove_cvref_t< T > >::value==2U > > >

template<typename T>
bool arene::base::is_pair_like_v< T, constraints< std::enable_if_t< std::tuple_size< remove_cvref_t< T > >::value==2U > > >
externconstexpr
Initial value:
=
constexpr bool is_tuple_like_v
Type trait to check if a type implements the tuple protocol.

Type trait to check if a type implements the tuple protocol and has a std::tuple_size of 2.

Template Parameters
TThe type to check

◆ is_possible_unit_for_v

template<typename Unit, typename Kind>
bool arene::base::is_possible_unit_for_v = is_possible_unit_for_detail::is_possible_unit_for_v<Unit, Kind>
externconstexpr

Type trait for detecting if a type is a unit for a specific quantity kind. Evaluates to true if Unit is a unit for Kind, false otherwise.

Template Parameters
Unitthe type to check
Kindthe type to check if the type is a unit for

◆ is_predicate_v

template<class F, class... Args>
bool arene::base::is_predicate_v = is_predicate_detail::is_predicate_impl<F, type_list<Args...>>::value
externconstexpr

backport for the C++20 predicate concept

Template Parameters
Fthe possible predicate
Argsthe argument types that the predicate is invoked with

The concept predicate<F, Args...> specifies that F is a predicate that accepts arguments whose types and value categories are encoded by Args..., i.e., it can be invoked with these arguments to produce a boolean-testable result.

◆ is_quantity_kind_v

template<typename Type>
bool arene::base::is_quantity_kind_v = is_quantity_kind_detail::is_quantity_kind_v<std::remove_cv_t<Type>>
externconstexpr

Type trait for detecting a quantity kind. Evaluates to true if the type is a quantity kind, false otherwise.

Template Parameters
Typethe type to check

◆ is_quantity_origin_v

template<typename Kind>
bool arene::base::is_quantity_origin_v = quantity_origin_detail::is_origin_v<Kind>
externconstexpr

Type trait to check if a quantity kind is itself an origin. The value is true if it is, false otherwise.

Template Parameters
KindQuantity kind to check

◆ is_random_access_iterator_v

template<typename T, typename = constraints<>>
bool arene::base::is_random_access_iterator_v = false
constexpr

Type trait to check if a type is a random-access iterator The value is true if the type meets the requirements, false otherwise.

Template Parameters
TThe type being checked

◆ is_random_access_iterator_v< T, constraints< std::enable_if_t< is_bidirectional_iterator_v< T > >, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< T >::iterator_category >::value >, std::enable_if_t< std::is_same<, T & >::value >, std::enable_if_t< std::is_same<, T >::value >, std::enable_if_t< std::is_same<, T >::value >, std::enable_if_t< std::is_same<, T & >::value >, std::enable_if_t< std::is_same<, T >::value >, std::enable_if_t< std::is_same<, typename std::iterator_traits< T >::difference_type >::value >, std::enable_if_t< std::is_same<, typename std::iterator_traits< T >::reference >::value >, std::enable_if_t< is_less_than_comparable_v< T > >, std::enable_if_t< is_greater_than_comparable_v< T > >, std::enable_if_t< is_less_than_or_equal_comparable_v< T > >, std::enable_if_t< is_greater_than_or_equal_comparable_v< T > > > >

Specialization for types that meets the syntactic requirements of a random access iterator

Template Parameters
TThe type being checked

◆ is_reference_wrapper_v

template<typename T>
bool arene::base::is_reference_wrapper_v = false
constexpr

◆ is_reference_wrapper_v< std::reference_wrapper< T > >

template<typename T>
bool arene::base::is_reference_wrapper_v< std::reference_wrapper< T > > = true
constexpr

◆ is_submdspan_slice_v

template<class IndexType, class Slice>
bool arene::base::is_submdspan_slice_v = is_submdspan_slice_detail::is_submdspan_slice_v<IndexType, Slice>
externconstexpr

helper trait to check if a type is a submdspan slice type

Template Parameters
IndexTypemdspan index type
Slicepotential submdspan slice type

Given a signed or unsigned integer type IndexType, a type Slice is a submdspan slice type for IndexType if at least one of the following holds:

◆ is_subtractable_v

template<typename Lhs, typename Rhs = Lhs>
bool arene::base::is_subtractable_v = arithmetic_traits_detail::is_subtractable_v<Lhs, Rhs>
externconstexpr

Check if instances of Rhs can be subtracted from an instance of Lhs. The value is true if they can be added, false otherwise.

Template Parameters
LhsThe type of the left-hand operand
RhsThe type of the right-hand operand, defaults to Lhs

◆ is_swappable_v

template<typename T>
bool arene::base::is_swappable_v = is_swappable_with_v<T&, T&>
externconstexpr

Trait query indicating if a type can be swapped.

Template Parameters
Tthe type to test
Returns
is_swappable_with_v<T&, T&>

◆ is_swappable_with_v

template<typename T, class U>
bool arene::base::is_swappable_with_v
externconstexpr
Initial value:
=
constexpr bool is_adl_swappable_with_v
Trait query if a two types have an ADL-discoverable swap function.
constexpr bool is_default_swappable_v
Trait query if a type can be swapped via the default implementation.

Trait query indicating two types can be swapped.

Template Parameters
Tthe first type to test
Uthe second type to test
Returns
If the expressions swap(std::declval<T>(),std::declval<U>()) and swap(std::declval<U>(),std::declval<T>()) are both well-formed in unevaluated context after using std::swap, the value equals true. Otherwise, the value is false.

◆ is_three_way_comparable_v

template<typename T, typename U = T, typename = constraints<>>
bool arene::base::is_three_way_comparable_v = false
externconstexpr

Type trait to check if an instance of type T can be compared to an instance of type U with a static three-way-compare member function that returns strong_ordering.

Template Parameters
TThe type of the lhs
UThe type of the rhs. Defaults to T
Returns
true If T::three_way_compare(T,U) is defined and returns strong_ordering .
false Otherwise.

◆ is_three_way_comparable_v< T, U, constraints< std::enable_if_t< std::is_same<, strong_ordering >::value > > >

template<typename T, typename U>
bool arene::base::is_three_way_comparable_v< T, U, constraints< std::enable_if_t< std::is_same<, strong_ordering >::value > > > = true
externconstexpr

Specialization for the case that T and U can be compared.

◆ is_transparent_comparator_for_v

template<typename C, typename T, typename U = T>
bool arene::base::is_transparent_comparator_for_v
externconstexpr
Initial value:
=
constexpr bool is_invocable_r_v
Determine if a functor type is invocable with the specified return and argument types.
constexpr bool is_transparent_comparator_v
Trait to determine if a given type is a transparent comparator.

Trait to determine if a given type is a transparent comparator for a given set of operands.

Template Parameters
CThe type to test
TThe type of the left hand operand
UThe type of the right hand operand
Returns
bool Will be equivalent to is_transparent_comparator_v<C> && is_invocable_r_v<bool, C, T, U>.

◆ is_transparent_comparator_v

template<typename C>
bool arene::base::is_transparent_comparator_v = is_transparent_comparator<C>::value
externconstexpr

Trait to determine if a given type is a transparent comparator.

Template Parameters
CThe type to test
Returns
true If C::is_transparent exists and is a type definition
false If C::is_transparent does not exist, or is not a type definition.

◆ is_transparent_three_way_comparator_for_v

template<typename C, typename T, typename U = T>
bool arene::base::is_transparent_three_way_comparator_for_v
externconstexpr
Initial value:

Trait to determine if a given type is a transparent comparator that performs a three-way comparison for a given set of operands.

Template Parameters
CThe type to test
TThe type of the left hand operand
UThe type of the right hand operand
Returns
bool Will be equivalent to is_transparent_comparator_v<C> && is_invocable_r_v<strong_ordering, C, T, U>.

◆ is_tuple_like_v

template<typename T, typename = constraints<>>
bool arene::base::is_tuple_like_v = false
externconstexpr

Type trait to check if a type implements the tuple protocol.

Note
A type implements the tuple protocol if it has get<Idx>() functions and specializations of std::tuple_size and std::tuple_element. The get<Idx>() implementations can either be member functions or free functions found by ADL; if both are present, the member functions are preferred.

Types implementing the tuple protocol can be used with structured bindings. Standard classes like std::tuple, std::pair, and std::array implement the tuple protocol, as does arene::base::array.

This trait checks that get<0>() and get<size-1>() both return types that are reference-compatible with tuple_element at the same index (convertible to tuple_element_t const&, for each of the four value categories of T). Intermediate indices are not checked for performance reasons. If tuple_size<T> == 0, the type is considered to be tuple-like regardless of the presence or behaviour of get and tuple_element.

Template Parameters
TThe type to check

◆ is_tuple_like_v< T, constraints< std::enable_if_t< std::tuple_size< remove_cvref_t< T > >::value==0U > > >

template<typename T>
bool arene::base::is_tuple_like_v< T, constraints< std::enable_if_t< std::tuple_size< remove_cvref_t< T > >::value==0U > > > = true
externconstexpr

Type trait to check if a type implements the tuple protocol.

Note
A type implements the tuple protocol if it has get<Idx>() functions and specializations of std::tuple_size and std::tuple_element. The get<Idx>() implementations can either be member functions or free functions found by ADL; if both are present, the member functions are preferred.

Types implementing the tuple protocol can be used with structured bindings. Standard classes like std::tuple, std::pair, and std::array implement the tuple protocol, as does arene::base::array.

This trait checks that get<0>() and get<size-1>() both return types that are reference-compatible with tuple_element at the same index (convertible to tuple_element_t const&, for each of the four value categories of T). Intermediate indices are not checked for performance reasons. If tuple_size<T> == 0, the type is considered to be tuple-like regardless of the presence or behaviour of get and tuple_element.

Template Parameters
TThe type to check

◆ is_unit_v

template<typename Kind>
bool arene::base::is_unit_v = is_unit_detail::is_unit_v<Kind>
externconstexpr

Type trait for detecting if a type is a unit. Evaluates to true if the type is a unit, false otherwise.

Template Parameters
Kindthe type to check

◆ last_index_of_v

template<typename T, typename... Ts>
auto arene::base::last_index_of_v = last_index_of<T, Ts...>::value
externconstexpr

Template meta-function for querying the last 0-based index of 'T' within a list of types, 'Ts...'.

The instantiation will be ill-formed if T is not a member of Ts...

Template Parameters
TThe type to search for.
TsThe list of types to search in.

◆ mdspan< ElementType, Extents, LayoutPolicy, AccessorPolicy >::rank

template<typename ElementType, typename Extents, typename LayoutPolicy, typename AccessorPolicy>
std:: integral_constant<typename mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>::rank_type, Extents::rank()> arene::base::mdspan< ElementType, Extents, LayoutPolicy, AccessorPolicy >::rank
constexpr

Get the number of dimensions in the extents.

Template Parameters
ElementTypethe element type
Extentsan instantiation of extents representing the shape of the multidimensional index space
LayoutPolicya layout policy (defaults to layout_right)
AccessorPolicyan accessor policy (defaults to default_accessor<ElementType>)

◆ mdspan< ElementType, Extents, LayoutPolicy, AccessorPolicy >::rank_dynamic

template<typename ElementType, typename Extents, typename LayoutPolicy, typename AccessorPolicy>
std::integral_constant< typename mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>::rank_type, Extents::rank_dynamic()> arene::base::mdspan< ElementType, Extents, LayoutPolicy, AccessorPolicy >::rank_dynamic
constexpr

Get the number of dimensions with dynamic extent.

Template Parameters
ElementTypethe element type
Extentsan instantiation of extents representing the shape of the multidimensional index space
LayoutPolicya layout policy (defaults to layout_right)
AccessorPolicyan accessor policy (defaults to default_accessor<ElementType>)

◆ member_function_cv_v

template<class F>
auto arene::base::member_function_cv_v = member_function_cv<F>::value
staticconstexpr

An enum representing the cv-qualification of a member function pointer type.

Template Parameters
Fmember function pointer type

◆ member_function_reference_v

template<class F>
auto arene::base::member_function_reference_v = member_function_reference<F>::value
staticconstexpr

An enum representing the reference-qualification of a member function pointer type.

Template Parameters
Fmember function pointer type

◆ negation_v

template<typename BoolTrait>
bool arene::base::negation_v {negation<BoolTrait>::value}
externconstexpr

The negated value of a boolean type trait.

Template Parameters
BoolTraitthe trait to negate
Returns
bool Equivalent to !BoolTrait::value .

◆ none_of_v

template<bool... Args>
bool arene::base::none_of_v = !any_of_v<Args...>
constexpr

Trait which tests if no values in a parameter pack are true .

Template Parameters
ArgsThe set of boolean values to test
Returns
true if no value in the parameter pack is true , or the parameter pack is empty.
false if all values in the parameter pack is false .

◆ null_opt

ARENE_MAYBE_UNUSED constexpr nullopt_t arene::base::null_opt {nullopt}
constexpr

alias to maintain backwards compatibility with older versions of Arene Base.

See also
arene::base::nullopt
Deprecated

◆ nullopt

ARENE_MAYBE_UNUSED constexpr nullopt_t arene::base::nullopt {{}}
constexpr

Tag variable for empty-optional construction.

◆ quantity_has_origin_v

template<typename Kind>
bool arene::base::quantity_has_origin_v = quantity_origin_detail::has_origin_v<Kind>
externconstexpr

Type trait to check if a quantity kind has an origin. The value is true if it does, false otherwise.

Template Parameters
KindQuantity kind to check

◆ sequential_values

template<typename ElementType, std::size_t Count, constraints< std::enable_if_t< sequential_values_detail::is_valid_size_v< Count > > > = nullptr>
auto arene::base::sequential_values = sequential_values_from<ElementType, 0, Count>
externconstexpr

An array holding a sequence of integer values starting at 0, incrementing by 1 each time.

Template Parameters
ElementTypeThe type of each element
CountThe number of elements in the sequence.

◆ sequential_values_between

template<typename ElementType, ElementType Begin, ElementType End, constraints< std::enable_if_t< sequential_values_detail::is_valid_size_v< std::size_t{End - Begin}> > > = nullptr>
auto arene::base::sequential_values_between
externconstexpr
Initial value:
=
constexpr auto sequential_values_from
An array holding a sequence of integer values starting at Begin, incrementing by 1 each time.

An array holding a sequence of integer values starting at Begin, ending at End and incrementing by 1 each time.

Template Parameters
ElementTypeThe type of each element
BeginThe first element in the sequence.
EndThe last element in the sequence.

◆ sequential_values_from

template<typename ElementType, ElementType Begin, std::size_t Count, constraints< std::enable_if_t< sequential_values_detail::is_valid_size_v< Count > > > = nullptr>
auto arene::base::sequential_values_from
externconstexpr
Initial value:
= sequential_values_detail::make_index_sequence_array<ElementType>(
make_integer_sequence_from<ElementType, Begin, static_cast<ElementType>(Count)>{}
)
typename make_integer_sequence_detail::make_from_impl< Type, Begin, Size >::type make_integer_sequence_from
Create an integer_sequence starting from a particular value.
Definition make_integer_sequence.hpp:89

An array holding a sequence of integer values starting at Begin, incrementing by 1 each time.

Template Parameters
ElementTypeThe type of each element
BeginThe first element in the sequence.
CountThe number of elements in the sequence.

◆ span< T, Extent >::extent

template<typename T, std::size_t Extent>
std::integral_constant<std::size_t, Extent> arene::base::span< T, Extent >::extent
constexpr

◆ substitution_succeeds

template<template< class... > class Template, class... P>
bool arene::base::substitution_succeeds = substitution_succeeds_impl::substitution_succeeds<void, Template, P...>
externconstexpr

Determines if a template can be instantiated successfully, similar to C++20's requires clause.

Returns
true if Template<P...> successfully undergoes substitution when in a SFINAE context, otherwise false.

This is generally used to help emulate "concepts" in a pattern such as the following example which detects if a type has a member function named foo() :

// The helper which uses the foo member function to force a SFINAE context.
template <typename T>
using use_foo = decltype(std::declval<T>().foo());
//
// The "concept" of having a foo member function, which apples substitution_succeeds to the foo usage.
template <typename T>
//
// Later in the code, this is used as a constraint:
template <typename T, arene::base::constraints<std::enable_if_t<has_foo<T>>> = nullptr>
void needs_foo(T const& thing);

◆ type_name_v

template<typename T>
auto arene::base::type_name_v {type_name_string_detail::get_type_name_string<T>()}
externconstexpr

The name of a type as an inline_string.

Template Parameters
TThe type to get the name of

◆ variant_npos

std::size_t arene::base::variant_npos {std::numeric_limits<std::size_t>::max()}
constexpr

Special value used as the return value of variant::index() when variant::valueless_by_exception() is true.

◆ variant_size_v

template<typename Variant>
std::size_t arene::base::variant_size_v = variant_npos
constexpr

Declaration of variant_size_v. Default to variant_npos.

◆ variant_size_v< variant< Ts... > >

template<typename... Ts>
std::size_t arene::base::variant_size_v< variant< Ts... > > = sizeof...(Ts)
constexpr

Specialization of variant_size_v for variant.

Template Parameters
Tsthe types in the variant

◆ variant_size_v< variant< Ts... > const >

template<typename... Ts>
std::size_t arene::base::variant_size_v< variant< Ts... > const > = sizeof...(Ts)
constexpr

Specialization of variant_size_v for const variant.

Template Parameters
Tsthe types in the variant

◆ version

std::uint32_t arene::base::version
constexpr
Initial value:
{
((version_major * version_detail::major_scale) + (version_minor * version_detail::minor_scale) + (version_patch))
}
ARENE_BASE_INLINE_ABI_NAMESPACE_OPEN_I_ constexpr std::uint32_t version_major
The major version for Arene.Base.
Definition version.hpp:44
constexpr std::uint32_t version_minor
The minor version for Arene.Base.
Definition version.hpp:48
constexpr std::uint32_t version_patch
The patch version for Arene.Base.
Definition version.hpp:51

The version of Arene.Base.

Remarks
Each 100's grouping (in decimal) a part of the version number. For example, a value of 5'021'001 is a major version of 5 , a minor version of 21 , and a patch version of 1.

◆ version_major

ARENE_BASE_INLINE_ABI_NAMESPACE_OPEN_I_ constexpr std::uint32_t arene::base::version_major {0U}
constexpr

The major version for Arene.Base.

◆ version_minor

std::uint32_t arene::base::version_minor {0U}
constexpr

The minor version for Arene.Base.

◆ version_patch

std::uint32_t arene::base::version_patch {0U}
constexpr

The patch version for Arene.Base.

◆ version_string

detail::raw_c_string arene::base::version_string {"0.0.0"}
constexpr

The version of Arene.Base as a string.