Showing content from https://timsong-cpp.github.io/cppwp/n4659/random.access.iterators below:
[random.access.iterators]
A class or pointer type X satisfies the requirements of a random access iterator if, in addition to satisfying the requirements for bidirectional iterators, the following expressions are valid as shown in Table 99.
Table
99
— Random access iterator requirements (in addition to bidirectional iterator)
Expression Return type Operational Assertion/note semantics pre-/post-condition r += n X& { difference_type m = n;
if (m >= 0)
while (m--)
++r;
else
while (m++)
--r;
return r; } a + n
n + a X { X tmp = a;
return tmp += n; } a + n == n + a. r -= n X& return r += -n; Requires: the absolute value of n is in the range of representable values of difference_type. a - n X { X tmp = a;
return tmp -= n; } b - a difference_type return n Requires: there exists a value n of type difference_type such that a + n == b.
b == a + (b - a). a[n] convertible to reference *(a + n) a < b contextually convertible to bool b - a > 0 < is a total ordering relation a > b contextually convertible to bool b < a > is a total ordering relation opposite to <. a >= b contextually convertible to bool !(a < b) a <= b contextually convertible to bool. !(a > b)
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4