A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4140/forward.iterators below:

[forward.iterators]

24.2.5 Forward iterators [forward.iterators]

A class or pointer type X satisfies the requirements of a forward iterator if

The domain of == for forward iterators is that of iterators over the same underlying sequence. However, value-initialized iterators may be compared and shall compare equal to other value-initialized iterators of the same type. [ Note: value initialized iterators behave as if they refer past the end of the same empty sequence  — end note ]

Two dereferenceable iterators a and b of type X offer the multi-pass guarantee if:

Note: The requirement that a == b implies ++a == ++b (which is not true for input and output iterators) and the removal of the restrictions on the number of the assignments through a mutable iterator (which applies to output iterators) allows the use of multi-pass one-directional algorithms with forward iterators.  — end note ]

Table

109

— Forward iterator requirements (in addition to input iterator)


Expression Return type Operational Assertion/note semantics pre-/post-condition r++ convertible to const X& { X tmp = r;
++r;
return tmp; } *r++ reference

If a and b are equal, then either a and b are both dereferenceable or else neither is dereferenceable.

If a and b are both dereferenceable, then a == b if and only if *a and *b are bound to the same object.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4