14 #ifndef RANGES_V3_ALGORITHM_UNSTABLE_REMOVE_IF_HPP
15 #define RANGES_V3_ALGORITHM_UNSTABLE_REMOVE_IF_HPP
33 #include <range/v3/utility/static_const.hpp>
35 #include <range/v3/detail/prologue.hpp>
45 RANGES_FUNC_BEGIN(unstable_remove_if)
51 constexpr I RANGES_FUNC(unstable_remove_if)(I
first, I last, C pred, P proj = {})
59 last = next(find_if_not(make_reverse_iterator(std::move(last)),
60 make_reverse_iterator(next(
first)),
67 *
first = iter_move(last);
75 template(
typename Rng,
typename C,
typename P = identity)(
76 requires bidirectional_range<Rng> AND common_range<Rng> AND
79 constexpr borrowed_iterator_t<Rng>
80 RANGES_FUNC(unstable_remove_if)(Rng && rng, C pred, P proj = P{})
82 return (*
this)(begin(rng), end(rng), std::move(pred), std::move(proj));
85 RANGES_FUNC_END(unstable_remove_if)
89 #include <range/v3/detail/epilogue.hpp>
template(typename I, typename C, typename P=identity)(requires bidirectional_iterator< I > AND permutable< I > AND indirect_unary_predicate< C
unstable_remove have O(1) complexity for each element remove, unlike remove O(n) [for worst case].
CPP_concept permutable
\concept permutable
Definition: concepts.hpp:840
CPP_concept indirect_unary_predicate
\concept indirect_unary_predicate
Definition: concepts.hpp:632
CPP_concept bidirectional_iterator
\concept bidirectional_iterator
Definition: concepts.hpp:390
front< Pair > first
Retrieve the first element of the pair Pair.
Definition: meta.hpp:2251
_t< detail::find_if_< L, Fn > > find_if
Return the tail of the list L starting at the first element A such that invoke<Fn,...
Definition: meta.hpp:2506
Definition: identity.hpp:25