std::experimental::ranges::SizedSentinel
Defined in header <experimental/ranges/iterator>
|
||
|
template
<
class S, class I >
concept bool SizedSentinel =
|
(1) | (ranges TS) |
|
template
<
class S, class I >
constexpr bool disable_sized_sentinel = false ; |
(1) | (ranges TS) |
The SizedSentinel concept specifies that an object of the iterator type I and an object of the sentinel type S can be subtracted to compute the distance between them in constant time.
Let i be an iterator of type I, and s a sentinel of type S such that
[
i
,
s
)
denotes a range. Let N be the smallest number of applications of ++i necessary to make bool(i == s) be true. Then SizedSentinel<S, I>
- If
Nis representable by ranges::difference_type_t<I>, then s - i is well-defined and equalsN - If
-Nis representable by ranges::difference_type_t<I>, then i - s is well-defined and equals-N
The variable template disable_sized_sentinel provides a mechanism for iterators and sentinels that can be subtracted but do not meet the semantic requirements of SizedSentinel to opt out of the concept by specializing the variable template to have the value true
Equality preservation
An expression is equality preserving if it results in equal outputs given equal inputs.
- The inputs to an expression consist of its operands.
- The outputs of an expression consist of its result and all operands modified by the expression (if any).
Every expression required to be equality preserving is further required to be stable
Unless noted otherwise, every expression used in a requires-expression
Implicit expression variations
A requires-expression implicit expression variations