struct random_access_iterator_tag {};| property | valid expressions |
|---|---|
| Is default-constructible, copy-constructible, copy-assignable and destructible | X a; |
| Can be compared for equivalence using the equality/inequality operators (meaningful when both iterator values iterate over the same underlying sequence). | a == b |
| Can be dereferenced as an rvalue (if in a dereferenceable state). | *a |
| For mutable iterators (non-constant iterators): Can be dereferenced as an lvalue (if in a dereferenceable state). | *a = t |
| Can be incremented (if in a dereferenceable state). The result is either also dereferenceable or a past-the-end iterator. Two iterators that compare equal, keep comparing equal after being both increased. | ++a |
| Can be decremented (if a dereferenceable iterator value precedes it). | --a a-- *a-- |
Supports the arithmetic operators + and - between an iterator and an integer value, or subtracting an iterator from another. | a + n |
Can be compared with inequality relational operators (<, >, <= and >=). | a < b |
Supports compound assignment operations += and -= | a += n |
Supports the offset dereference operator ([]) | a[n] |
| property | valid expressions |
|---|---|
| Is default-constructible, copy-constructible, copy-assignable and destructible | X a; |
| Can be compared for equivalence using the equality/inequality operators (meaningful when both iterator values iterate over the same underlying sequence). | a == b |
| Can be dereferenced as an rvalue (if in a dereferenceable state). | *a |
| For mutable iterators (non-constant iterators): Can be dereferenced as an lvalue (if in a dereferenceable state). | *a = t |
| Can be incremented (if in a dereferenceable state). The result is either also dereferenceable or a past-the-end iterator. Two iterators that compare equal, keep comparing equal after being both increased. | ++a |
| Can be decremented (if a dereferenceable iterator value precedes it). | --a a-- *a-- |
Supports the arithmetic operators + and - between an iterator and an integer value, or subtracting an iterator from another. | a + n |
Can be compared with inequality relational operators (<, >, <= and >=). | a < b |
Supports compound assignment operations += and -= | a += n |
Supports the offset dereference operator ([]) | a[n] |
| Lvalues are swappable. | swap(a,b) |
const T&).