std::advance (3) - Linux Manuals
Defined in header <iterator>
template< class InputIt, class Distance > (until C++17)
void advance( InputIt& it, Distance n );
template< class InputIt, class Distance > (since C++17)
constexpr void advance( InputIt& it, Distance n );
Increments given iterator it by n elements.
If n is negative, the iterator is decremented. In this case, InputIt must meet the requirements of LegacyBidirectionalIterator, otherwise the behavior is undefined.
it - iterator to be advanced
n - number of elements it should be advanced
InputIt must meet the requirements of LegacyInputIterator.
However, if InputIt additionally meets the requirements of LegacyRandomAccessIterator, complexity is constant.
The behavior is undefined if the specified sequence of increments or decrements would require that a non-incrementable iterator (such as the past-the-end iterator) is incremented, or that a non-decrementable iterator (such as the front iterator or the singular iterator) is decremented.
// Run this code
next increment an iterator
distance (function template)