Defined in header
constexpr /* unspecified */ advance = /* unspecified */;
| (ranges TS)
(customization point object)
template< Iterator I >
constexpr void advance(I& i, ranges::difference_type_t<I> n);
Advances the iterator
n times, or until
bound is reached, whichever comes first.
RandomAccessIterator, equivalent to i += n. Otherwise, increments (or decrements if
ntimes. The behavior is undefined if
nis negative and
Idoes not model
[i, bound)does not denote a range, the behavior is undefined.
iuntil i == bound.
ntimes or until i == bound, whichever comes first.
n > 0,
[i, bound)shall denote a range; if
n == 0, either
[bound, i)shall denote a range; if
n < 0,
[bound, i)shall denote a range,
Sshall be the same type, and
BidirectionalIterator. Otherwise, the behavior is undefined.
 Customization point objects
ranges::advance denotes a customization point object, which is a function object of a literal
Semiregular class type (denoted, for exposition purposes, as
AdvanceT). All instances of
AdvanceT are equal. Thus,
ranges::advance can be copied freely and its copies can be used interchangeably.
Given a set of types
Args..., if std::declval<Args>()... meet the requirements for arguments to
AdvanceT will satisfy ranges::Invocable<const AdvanceT, Args...>. Otherwise, no function call operator of
AdvanceT participates in overload resolution.
In every translation unit in which
ranges::advance is defined, it refers to the same instance of the customization point object. (This means that it can be used freely in things like inline functions and function templates without violating the one-definition rule.)
 Return value
bound. In other words,
n - M, where
Mis the distance from the starting position of
ito the ending position and is negative if the ending position is before the starting position.
|This section is incomplete|
Reason: no example
 See also
| advances an iterator by given distance |
| returns the distance between an iterator and a sentinel, or between the beginning and the end of a range |
| increment an iterator |
| decrement an iterator |