A class or pointer type X satisfies the requirements of a bidirectional iterator if, in addition to satisfying the requirements for forward iterators, the following expressions are valid as shown in Table 98.
Expression | Return type | Operational | Assertion/note |
semantics | pre-/post-condition | ||
--r | X& |
Requires: there exists s such that r == ++s. Postconditions: r is dereferenceable. --(++r) == r. --r == --s implies r == s. &r == &--r. | |
r-- | convertible to const X& |
{ X tmp = r; --r; return tmp; } | |
*r-- | reference |