<xstd/bits/bit_algorithm/bit_find.hpp>, <xstd/bits/bit_algorithm/bit_find_last.hpp>¶
bit_find, bit_find_last¶
As ranges::find and ranges::find_last in [alg.find] and
[alg.find.last], with:
- Constraints:
Ris a sequence of ours, a window included. - Returns: For
bit_find,ranges::begin(r) + i, whereiis the first position holdingvalue, orranges::size(r)where none does. Forbit_find_last,{ranges::begin(r) + i, ranges::end(r)}, whereiis the last such position, or{ranges::end(r), ranges::end(r)}where none is. - Complexity: O(
N/D).bit_findreads up from the first block andbit_find_lastdown from the last, each stopping at the block that holds the answer. A search forfalsereads the blocks complemented, at the same cost.