13#ifndef RANGES_V3_ALGORITHM_REPLACE_COPY_HPP
14#define RANGES_V3_ALGORITHM_REPLACE_COPY_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_result = detail::in_out_result<I, O>;
40 RANGES_FUNC_BEGIN(replace_copy)
52 constexpr replace_copy_result<I, O> RANGES_FUNC(replace_copy)(I
first,
62 if(
invoke(proj, x) == old_value)
65 *out = (
decltype(x) &&)x;
71 template(
typename Rng,
79 constexpr replace_copy_result<borrowed_iterator_t<Rng>, O> RANGES_FUNC(replace_copy)(
80 Rng && rng, O out, T1
const & old_value, T2
const & new_value, P proj = {})
82 return (*
this)(begin(rng),
90 RANGES_FUNC_END(replace_copy)
94 using ranges::replace_copy;
95 using ranges::replace_copy_result;
100#include <range/v3/detail/epilogue.hpp>
The indirect_relation concept.
The indirectly_copyable concept.
The output_iterator concept.
The sentinel_for concept.
template(typename Rng, typename O, typename T1, typename T2, typename P=identity)(AND output_iterator< O
This is an overloaded member function, provided for convenience. It differs from the above function o...
decltype(begin(declval(Rng &))) iterator_t
Definition: access.hpp:698
typename Fn::template invoke< Args... > invoke
Evaluate the invocable Fn with the arguments Args.
Definition: meta.hpp:541
front< Pair > first
Retrieve the first element of the pair Pair.
Definition: meta.hpp:2251
Definition: comparisons.hpp:28
Definition: identity.hpp:25