<xstd/bits/bit_algorithm/bit_for_each.hpp>¶
bit_for_each¶
As ranges::for_each in [alg.foreach], with:
- Constraints:
invocable<F&, ranges::range_value_t<R>>is modeled, and:- for the first form,
Ris a sequence or a set of ours, a window included; - for the second,
remove_cvref_t<R>isranges::reverse_view<V>, whereVis a view of ours or aranges::ref_viewof an owner of ours: whatviews::reversemakes of a view or of an lvalue owner.
- for the first form,
- Effects: Calls
fwith each element by value, aboolor a key, in the orderriterates. The second form walks the range under thereverse_viewagainst its order, sobit_for_each(views::reverse(r), f)isranges::for_each(views::reverse(r), f). - Returns:
{ranges::end(r), std::move(f)}. - Complexity: Exactly
ranges::distance(r)applications off, and one load per block. A set's keys come from each block lowest first or highest first, as the set and the direction order them. - A functor that takes the element as a non-
constlvalue reference is turned away, and of a functor overloaded on value category the overload taking an rvalue is the one called. - A functor returning
boolis called on every element, its answer ignored, asranges::for_eachcalls it.