13#ifndef RANGES_V3_ALGORITHM_REPLACE_COPY_IF_HPP
14#define RANGES_V3_ALGORITHM_REPLACE_COPY_IF_HPP
20#include <range/v3/algorithm/result_types.hpp>
29#include <range/v3/utility/static_const.hpp>
31#include <range/v3/detail/prologue.hpp>
37 template<
typename I,
typename O>
38 using replace_copy_if_result = detail::in_out_result<I, O>;
40 RANGES_FUNC_BEGIN(replace_copy_if)
53 constexpr replace_copy_if_result<I, O> RANGES_FUNC(replace_copy_if)(
54 I first, S last, O out, C pred, T const & new_value, P proj = {})
56 for(; first != last; ++first, ++out)
59 if(invoke(pred, invoke(proj, x)))
62 *out = (
decltype(x) &&)x;
68 template(
typename Rng,
typename O,
typename C,
typename T,
typename P =
identity)(
72 constexpr replace_copy_if_result<borrowed_iterator_t<Rng>, O> RANGES_FUNC(replace_copy_if)(
73 Rng && rng, O out, C pred, T
const & new_value, P proj = {})
75 return (*
this)(begin(rng),
83 RANGES_FUNC_END(replace_copy_if)
87 using ranges::replace_copy_if;
88 using ranges::replace_copy_if_result;
93#include <range/v3/detail/epilogue.hpp>
The indirect_unary_predicate concept.
The indirectly_copyable concept.
The output_iterator concept.
The sentinel_for concept.
decltype(begin(declval(Rng &))) iterator_t
Definition access.hpp:698
front< Pair > first
Retrieve the first element of the pair Pair.
Definition meta.hpp:2251
Definition identity.hpp:25