Files
2025-10-25 03:02:53 +03:00

1.7 KiB
Raw Permalink Blame History

[range.iter.ops.general]

24 Iterators library [iterators]

24.4 Iterator primitives [iterator.primitives]

24.4.4 Range iterator operations [range.iter.ops]

24.4.4.1 General [range.iter.ops.general]

1

#

The library includes the function templatesranges::advance, ranges::distance,ranges::next, and ranges::prev to manipulate iterators.

These operations adapt to the set of operators provided by each iterator category to provide the most efficient implementation possible for a concrete iterator type.

[Example 1:

ranges::advance uses the + operator to move arandom_access_iterator forward n steps in constant time.

For an iterator type that does not model random_access_iterator,ranges::advance instead performs n individual increments with the ++ operator.

— end example]

2

#

The entities defined in [range.iter.ops] are algorithm function objects ([alg.func.obj]).