std::experi...crementable(3)
π std::experi...crementable(3) π
okay bestie, welcome to the C++ Standard Libary manual β yes, βLibaryβ is literally how itβs spelled here β and this page is all about std::experimental::ranges::WeaklyIncrementable. Itβs giving ranges TS energy, and weβre gonna read it together, no cap. π«Ά
π NAME π
std::experimental::ranges::WeaklyIncrementable β std::experimental::ranges::WeaklyIncrementable
β¨ Synopsis β¨
Defined in header <experimental/ranges/iterator>.
template< class I >
concept bool WeaklyIncrementable =
Semiregular<I> &&
requires(I i) {
typename ranges::difference_type_t<I>;
(ranges TS)
requires SignedIntegral<ranges::difference_type_t<I>>;
{ ++i } -> Same<I>&; /* not required to be equality preserving */
i++; /* not required to be equality preserving */
};
The concept WeaklyIncrementable<I> specifies the requirements on a type that can be incremented (with the pre- and post-increment operators). The increment operations need not be equality-preserving, and the type need not be EqualityComparable.
Let i be an object of type I. i is said to be incrementable if it is in the domain of both pre- and post-increment. WeaklyIncrementable<I> is satisfied only if:
++iandi++have the same domain;- If i is incrementable, then:
++iandi++both advance i to the next element; and++irefers to the same object as i.
π«Ά 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: two evaluations of such an expression with the same input objects must have equal outputs absent any explicit intervening modification of those input objects.
πΈ Notes πΈ
For WeaklyIncrementable types, βa equals bβ does not imply that ++a equals ++b. Algorithms on such types should be single pass and never attempt to pass through the same value twice. π
Thatβs the tea, bestie: this page comes from cppreference.com, dated 2024.06.10, and itβs literally the std::experi...crementable(3) manual page. Periodt. πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms