![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
| using arene::base::ranges::borrowed_iterator_t |
A type alias conditionally selects between a ranges iterator or arene::base::dangling .
| Rng | The range type for which to obtain the borrowed iterator type. |
If Rng satisfies arene::base::is_borrowed_range_v<Rng>, the type alias resolves to arene::base::ranges::iterator_t<Rng> . Otherwise, it resolves to arene::base::ranges::dangling . This can be used to safely create range algorithms which should match all range types, but only return valid content if the input is a borrowed range.
| arene::base::ranges::ARENE_CPP14_INLINE_VARIABLE | ( | begin_end_detail::accessor_fn< begin_end_detail::begin_policy > | , |
| begin | ) |
returns an iterator to the beginning of a range
| Rng | The type of the range to get the beginning of. Must satisfy either std::is_lvalue_reference<Rng> or enable_borrowed_range_v<Rng>. The range to inspect is passed as rng. |
Rng satisfies std::is_array<Rng> , returns &rng[0] .rng.begin() is well-formed, returns rng.begin() .begin(rng) is well-formed, returns begin(rng) .If none of the requirements are satisfied, the function does not participate in overload resolution.
| arene::base::ranges::ARENE_CPP14_INLINE_VARIABLE | ( | begin_end_detail::accessor_fn< begin_end_detail::end_policy > | , |
| end | ) |
returns an iterator to the end of a range
| Rng | The type of the range to get the end of. Must satisfy either std::is_lvalue_reference<Rng> or enable_borrowed_range_v<Rng>. The range to inspect is passed as rng. |
Rng satisfies std::is_array<Rng> , returns &rng[std::extent<Rng>::value] .rng.end() is well-formed, returns rng.end() .end(rng) is well-formed, returns end(rng) .If none of the requirements are satisfied, the function does not participate in overload resolution.
| arene::base::ranges::ARENE_CPP14_INLINE_VARIABLE | ( | itr_move_detail::iter_move_fn | , |
| iter_move | ) |
Performs the move operation on dereferenced value of a dereferenceable type.
| Itr | The type of the iterator to apply iter_move to. The iterator to move from is passed as iterator. |
This operation is expression-equivalent to one of the following operations, in order of preference:
Itr satisfies either std::is_class or std::is_enum , and iter_move(itr) is well-formed by argument dependent lookup, returns iter_move(itr) .*itr is well-formed:*itr is an lvalue reference, returns std::move(*itr) .*itr .If none of the requirements are satisfied, then iter_move is ill-formed. This can cause a substitution failure when iter_move appears in the context of a template instantiation.
| arene::base::ranges::ARENE_CPP14_INLINE_VARIABLE | ( | size_detail::size_fn | , |
| size | ) |
Returns an integer equal to the size of a range.
size is intended to be a constant time operation. Callers of this function should generally assume this runs in constant time and is ill-formed for types which don't have a constant-time size, but we can not enforce this for range types that we don't control. Use arene::base::distance if you want to disclaim this constant time guarantee.
To container implementers: if your container has member or ADL size functions then size will pick them up and assume that they can operate in constant time. If your type's size is not constant time, specialize arene::base::ranges::disable_sized_range for it so that size ignores those functions.
|
externconstexpr |
Accessor for the value of disable_sized_range .
| Rng | The range type to check. |
disable_sized_range<Rng>::value .
|
externconstexpr |
Query if a range type has opted into being a borrowed range.
| Rng | The range type to check. |
enable_borrowed_range<Rng>::value . enable_borrowed_range_v directly; it is intended for use by the range library to detect enable_borrowed_range customizations, and should only be used for that purpose. Instead, use arene::base::is_borrowed_range_v<Rng> to query if a type qualifies as a borrowed range when implementing generic algorithms.
|
externconstexpr |
Predicate to check if a type is a borrowed range.
| Rng | The type to check. |
is_borrowed_range<Rng>::value .
|
externconstexpr |
Predicate to check if a type is a range.
| Rng | The type to check. |
true if Rng is a range, false otherwise. A type Rng is considered a range if and only if all of the following are true when considering an instance rng of Rng, with the ref-qualification of Rng preserved:ranges::begin(rng) is a well-formed expression.ranges::end(rng) is a well-formed expression. | using arene::base::ranges::iterator_t |
The type of the iterator for a given range.
| Rng | The type of the range to extract the iterator for. |
| using arene::base::ranges::sentinel_t |
The type of the sentinel (end iterator) for a given range.
| Rng | The type of the range to extract the sentinel for. |