function object
std::ranges::replace_copy
- Header
<algorithm>- Draft
- [alg.replace]
- Scope
std::ranges- cppreference
- std::ranges::replace_copy
Synopsis
inline constexpr /* implementation-defined */ replace_copy = {};Call signatures
replace_copy is a function object; these are its call operators as libycxx declares them, written as the functions the draft declares.
- (1)
template< std::ranges::input_range R, class O, class Proj = std::identity, class T1 = std::projected_value_t<iterator_t<R>, Proj>, class T2 = std::iter_value_t<O>> requires std::indirectly_copyable<iterator_t<R>, O> && std::indirect_binary_predicate<std::ranges::equal_to, std::projected<iterator_t<R>, Proj>, const T1*> && std::output_iterator<O, const T2&> constexpr std::ranges::replace_copy_result<borrowed_iterator_t<R>, O> replace_copy( R&& r, O result, const T1& old_value, const T2& new_value, Proj proj = {}); - (2)
template< std::input_iterator I, std::sentinel_for<I> S, class O, class Proj = std::identity, class T1 = std::projected_value_t<I, Proj>, class T2 = std::iter_value_t<O>> requires std::indirectly_copyable<I, O> && std::indirect_binary_predicate<std::ranges::equal_to, std::projected<I, Proj>, const T1*> && std::output_iterator<O, const T2&> constexpr std::ranges::replace_copy_result<I, O> replace_copy( I first, S last, O result, const T1& old_value, const T2& new_value, Proj proj = {}); - (3)
template< class ExecutionPolicy, sized_random_access_range R, sized_random_access_range OutR, class Proj = std::identity, class T1 = std::projected_value_t<std::ranges::iterator_t<R>, Proj>, class T2 = std::ranges::range_value_t<OutR>> requires execution-policy<ExecutionPolicy> && std::indirectly_copyable<std::ranges::iterator_t<R>, std::ranges::iterator_t<OutR>> && std::indirect_binary_predicate<std::ranges::equal_to, std::projected<std::ranges::iterator_t<R>, Proj>, const T1*> && std::indirectly_writable<std::ranges::iterator_t<OutR>, const T2&> std::ranges::in_out_result<std::ranges::borrowed_iterator_t<R>, std::ranges::borrowed_iterator_t<OutR>> replace_copy( ExecutionPolicy&& exec, R&& r, OutR&& result_r, const T1& old_value, const T2& new_value, Proj proj = {}) noexcept; - (4)
template< class ExecutionPolicy, std::random_access_iterator I, std::sized_sentinel_for<I> S, std::random_access_iterator O, std::sized_sentinel_for<O> OutS, class Proj = std::identity, class T1 = std::projected_value_t<I, Proj>, class T2 = std::iter_value_t<O>> requires execution-policy<ExecutionPolicy> && std::indirectly_copyable<I, O> && std::indirect_binary_predicate<std::ranges::equal_to, std::projected<I, Proj>, const T1*> && std::indirectly_writable<O, const T2&> std::ranges::in_out_result<I, O> replace_copy( ExecutionPolicy&&, I first, S last, O result, OutS result_last, const T1& old_value, const T2& new_value, Proj proj = {}) noexcept;