advance(i, n) increments the iterator
i by the distance
n > 0 it is equivalent to executing
n times, and if
n < 0 it is equivalent to executing
n times. If
n == 0, the call has no effect.
|i||The iterator to be advanced. |
|n||The distance by which to advance the iterator.|
- Template Parameters
|InputIterator||is a model of Input Iterator. |
|Distance||is an integral type that is convertible to |
InputIterator's distance type.
n shall be negative only for bidirectional and random access iterators.
The following code snippet demonstrates how to use
advance to increment an iterator a given number of times.
- See Also
Referenced by thrust::iterator_facade< Derived, Value, System, Traversal, Reference, Difference >::operator+=(), and thrust::iterator_facade< Derived, Value, System, Traversal, Reference, Difference >::operator-=().