|
constexprnoexcept |
Returns an object of an unspecified type which is an iterator of the same category as the parameter but redefines the respective comparison operators to keep the current offset from the initial position given parametrically.
Iterator | A type of it . It can be any iterator satisfying the Iterator requirements, although the effect of calling any iterator-related operators other than the comparison operators is not defined. |
it | An iterator to adapt to a counting iterator. |
offset | A numeric offset, in iterated elements, of a position for the created iterator to correspond to. The position is specified relatively to it . The type of the parameter is either typename std::iterator_traits<Iterator>::difference_type
void , e.g. for output iterators, the type of offset defaults to std::ptrdiff_t . |
it
which delegates all calls except for the comparison operators to it
and redefines the comparison operators to take into account an offset of the iterator from the initial position which corresponds to it
shifted to the right (i.e. incremented) offset
times. The returned iterator provides operators for changing its position and dereferencing, but the effect of invoking these operators, e.g. any operatiors other than comparison operators and assignment, is undefined.The offset_iterator_begin and offset_iterator_end functions allow iterations inside code that has a range based interface (i.e. one that given by a pair of a beginning and an ending iterator) based on only a given beginning iterator and a number of elements to read, even when the given iterator is an InputIterator or an OutputIterator.
The function is marked noexcept if a copy-construction of it
is noexcept.
Output:
234