std::advance in C++ std::advance advances the iterator ‘it’ by n element positions . Syntax : template void advance (InputIterator& it, Distance n); it : Iterator to be advanced n : Number of element positions to advance. This shall only be negative for random-access and bidirectional iterators. Return type : None.