std::experi...ardIterator(3)
πΈ NAME πΈ
okay so this is the std::experi...ardIterator(3) page from the C++ Standard Libary manual β yes, βLibaryβ with the typo, we are not fixing it π
. Itβs all about:
std::experimental::ranges::ForwardIteratorβ the concept in question, bestie.std::experimental::ranges::ForwardIteratorβ and yep, the original NAME section literally lists it twice, so weβre keeping both. periodt π«Ά
β¨ Synopsis β¨
The exact synopsis, no edits, no cap:
Defined in header <experimental/ranges/iterator>
template< class I >
concept bool ForwardIterator =
InputIterator<I> &&
DerivedFrom<ranges::iterator_category_t<I>,
(ranges TS)
ranges::forward_iterator_tag> &&
Incrementable<I> &&
Sentinel<I, I>;
The concept ForwardIterator<I> refines InputIterator by adding equality comparison and the multi-pass guarantee. slay.
The domain of == for forward iterators is that of iterators over the same underlying sequence, except that value-initialized iterators of the same type may be compared with each other and shall compare equal. iykyk? Thatβs the rule. β¨
Pointers and references obtained from a forward iterator into a range [i, s) must remain valid while [i, s) continues to denote a range. no cap, they have to stay valid. π«Ά
Let a and b be two dereferenceable iterators of type I. ForwardIterator<I> is satisfied only if:
a == bimplies++a == ++b; and- The expression
([](X x){ ++x; }(a), *a)is equivalent to*a, i.e., incrementing a copy ofahas no effect on the result of dereferencinga.
This is known as the multi-pass guarantee. iconic, honestly. π
π Notes π
A forward iterator cannot be "stashing": it cannot return a reference to an object within itself, because such references would be invalidated by the destruction of the forward iterator. so no stashing, bestie β that would be a whole mess. π
π cute little footer sign-off: sourcehttp://cppreference.com, version/date2024.06.10, pagestd::experi...ardIterator(3). thatβs the whole footer, bestie β bye! π«Άβ¨
π¦ 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