[bidirectional.iterators]

# 24 Iterators library [[iterators]](./#iterators)

## 24.3 Iterator requirements [[iterator.requirements]](iterator.requirements#bidirectional.iterators)

### 24.3.5 C++17 iterator requirements [[iterator.cpp17]](iterator.cpp17#bidirectional.iterators)

#### 24.3.5.6 Bidirectional iterators [bidirectional.iterators]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L2309)

A class or pointer typeX meets the requirements of a bidirectional iterator if,
in addition to meeting the *Cpp17ForwardIterator* requirements,
the following expressions are valid as shown in Table [82](#tab:bidirectionaliterator "Table 82: Cpp17BidirectionalIterator requirements (in addition to Cpp17ForwardIterator)")[.](#1.sentence-1)

Table [82](#tab:bidirectionaliterator) — *Cpp17BidirectionalIterator* requirements (in addition to *Cpp17ForwardIterator*) [[tab:bidirectionaliterator]](./tab:bidirectionaliterator)  

| [ð](#tab:bidirectionaliterator-row-1)<br>**Expression** | **Return type** | **Operational** | **Assertion/note** |
| --- | --- | --- | --- |
| [ð](#tab:bidirectionaliterator-row-2) |  | **semantics** | **pre-/post-condition** |
| [ð](#tab:bidirectionaliterator-row-3)<br>--r | X& |  | *Preconditions*: there exists s such that r == ++s[.](#tab:bidirectionaliterator-row-3-column-4-sentence-1)<br>   *Postconditions*: r is dereferenceable[.](#tab:bidirectionaliterator-row-3-column-4-sentence-2)<br>   --(++r) == r[.](#tab:bidirectionaliterator-row-3-column-4-sentence-3)<br>   --r == --s implies r == s[.](#tab:bidirectionaliterator-row-3-column-4-sentence-4)<br>   addressof(r) == addressof(--r)[.](#tab:bidirectionaliterator-row-3-column-4-sentence-5) |
| [ð](#tab:bidirectionaliterator-row-4)<br>r-- | convertible to const X& | { X tmp = r;    --r;    return tmp; } |  |
| [ð](#tab:bidirectionaliterator-row-5)<br>*r-- | reference |  |  |

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L2342)

[*Note [1](#note-1)*:

Bidirectional iterators allow algorithms to move iterators backward as well as forward[.](#2.sentence-1)

â *end note*]
