13#ifndef RANGES_V3_ALGORITHM_REPLACE_IF_HPP
14#define RANGES_V3_ALGORITHM_REPLACE_IF_HPP
28#include <range/v3/utility/static_const.hpp>
30#include <range/v3/detail/prologue.hpp>
36 RANGES_FUNC_BEGIN(replace_if)
39 template(typename I, typename S, typename C, typename T, typename P =
identity)(
43 constexpr I RANGES_FUNC(replace_if)(
44 I first, S last, C pred, T const & new_value, P proj = P{})
46 for(; first != last; ++first)
47 if(invoke(pred, invoke(proj, *first)))
53 template(
typename Rng,
typename C,
typename T,
typename P =
identity)(
57 constexpr borrowed_iterator_t<Rng> RANGES_FUNC(replace_if)(
58 Rng && rng, C pred, T
const & new_value, P proj = P{})
61 begin(rng), end(rng), std::move(pred), new_value, std::move(proj));
64 RANGES_FUNC_END(replace_if)
68 using ranges::replace_if;
73#include <range/v3/detail/epilogue.hpp>
The indirect_unary_predicate concept.
The indirectly_writable concept.
The sentinel_for concept.
decltype(begin(declval(Rng &))) iterator_t
Definition access.hpp:698
Definition identity.hpp:25