[iterator.concept.bidir]

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

## 24.3 Iterator requirements [[iterator.requirements]](iterator.requirements#iterator.concept.bidir)

### 24.3.4 Iterator concepts [[iterator.concepts]](iterator.concepts#iterator.concept.bidir)

#### 24.3.4.12 Concept bidirectional_iterator [iterator.concept.bidir]

[1](#1)

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

The [bidirectional_iterator](#concept:bidirectional_iterator "24.3.4.12 Concept bidirectional_­iterator [iterator.concept.bidir]") concept adds the ability
to move an iterator backward as well as forward[.](#1.sentence-1)

template<class I>concept [bidirectional_iterator](#concept:bidirectional_iterator "24.3.4.12 Concept bidirectional_­iterator [iterator.concept.bidir]") =[forward_iterator](iterator.concept.forward#concept:forward_iterator "24.3.4.11 Concept forward_­iterator [iterator.concept.forward]")<I> &&[derived_from](concept.derived#concept:derived_from "18.4.3 Concept derived_­from [concept.derived]")<*ITER_CONCEPT*(I), bidirectional_iterator_tag> &&requires(I i) {{ --i } -> [same_as](concept.same#concept:same_as "18.4.2 Concept same_­as [concept.same]")<I&>; { i-- } -> [same_as](concept.same#concept:same_as "18.4.2 Concept same_­as [concept.same]")<I>; };

[2](#2)

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

A bidirectional iterator r is decrementable if and only if there exists some q such that++q == r[.](#2.sentence-1)

Decrementable iterators r shall be in the domain of the expressions--r and r--[.](#2.sentence-2)

[3](#3)

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

Let a and b be equal objects of type I[.](#3.sentence-1)

I models [bidirectional_iterator](#concept:bidirectional_iterator "24.3.4.12 Concept bidirectional_­iterator [iterator.concept.bidir]") only if:

- [(3.1)](#3.1)

If a and b are decrementable,
 then all of the following are true:
  * [(3.1.1)](#3.1.1)

addressof(--a) == addressof(a)

  * [(3.1.2)](#3.1.2)

bool(a-- == b)

  * [(3.1.3)](#3.1.3)

after evaluating both a-- and --b, bool(a == b) is still true

  * [(3.1.4)](#3.1.4)

bool(++(--a) == b)

- [(3.2)](#3.2)

If a and b are incrementable, then bool(--(++a) == b)[.](#3.sentence-2)
