[range.iter.op.advance] (original) (raw)
24 Iterators library [iterators]
24.4 Iterator primitives [iterator.primitives]
24.4.4 Range iterator operations [range.iter.ops]
24.4.4.2 ranges::advance [range.iter.op.advance]
Effects:
Effects:
- If I and S model assignable_from<I&, S>, equivalent to i = std::move(bound).
- Otherwise, if S and I model sized_sentinel_for<S, I>, equivalent to ranges::advance(i, bound - i).
- Otherwise, while bool(i != bound) is true, increments i.
Preconditions: If n > 0, [i, bound) denotes a range.
If n == 0, [i, bound) or [bound, i) denotes a range.
Effects:
- If S and I model sized_sentinel_for<S, I>:
- Otherwise,
Returns: n - M, where M is the difference between the ending and starting positions of i.