<xstd/bits/bit_iterator/bit_advance.hpp>¶
bit_advance¶
As ranges::advance in [range.iter.ops], with:
- Constraints:
Iis an iterator of ours. - Preconditions: As [range.iter.ops]'s. For the first form over a set,
the
nkeys are there to step over, checked by anassert. - Effects: Over a sequence,
ranges::advance(it, n)andranges::advance(it, n, bound). Over a set, movesitnkeys on in the set's order, or-nback, skipping whole blocks by their popcount and selecting the key within the block that holds it, from the block's top where the walk goes down; the second form stops atbound. - Returns: For the second form, the steps not taken, with the sign of
n, asranges::advance(it, n, bound)answers them. - Complexity: Constant over a sequence. Over a set, linear in the number of blocks between
itand where it stops, rather than one step per key. - A view's iterators step over the keys it views, its owner's or lent blocks, and an empty set's
begin()is itsend().