C++ named requirements: LegacyBidirectionalIterator
A LegacyBidirectionalIterator is a LegacyForwardIterator that can be moved in both directions (i.e. incremented and decremented).
Contents |
[edit] Requirements
The type It satisfies LegacyBidirectionalIterator if
- The type
Itsatisfies LegacyForwardIterator
And, given
-
aandb, iterators of typeIt -
reference,the type denoted bystd::iterator_traits<It>::reference
The following expressions must be valid and have their specified effects
| Expression | Return | Equivalent expression | Notes |
|---|---|---|---|
| --a | It& | Preconditions:
Postconditions:
| |
| a-- | convertible to const It& | It temp = a; --a; |
|
| *a-- | reference |
A mutable LegacyBidirectionalIterator is a LegacyBidirectionalIterator that additionally satisfies the LegacyOutputIterator requirements.
[edit] Notes
The begin iterator is not decrementable and the behavior is undefined if --container.begin() is evaluated.
A bidirectional iterator does not have to be dereferenceable to be decrementable (in particular, the end iterator is not dereferenceable but is decrementable)
ConceptFor the definition of std::iterator_traits, the following exposition-only concept is defined. where the exposition-only concept |
(since C++20) |
[edit] See also
specifies that a ForwardIterator is a bidirectional iterator, supporting movement backwards (concept) |