libycxx

function object

std::ranges::replace

Scope
std::ranges

Synopsis

inline constexpr /* implementation-defined */ replace = {};

Call signatures

replace 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 Proj = std::identity,
        class T1 = std::projected_value_t<iterator_t<R>, Proj>,
        class T2 = std::ranges::range_value_t<R>>
      requires std::indirectly_writable<iterator_t<R>, const T2&> &&
                 std::indirect_binary_predicate<std::ranges::equal_to, std::projected<iterator_t<R>, Proj>, const T1*>
    constexpr borrowed_iterator_t<R> replace(
        R&& r,
        const T1& old_value,
        const T2& new_value,
        Proj proj = {});
    (1)
  2. template<
        std::input_iterator I,
        std::sentinel_for<I> S,
        class Proj = std::identity,
        class T1 = std::projected_value_t<I, Proj>,
        class T2 = std::iter_value_t<I>>
      requires std::indirectly_writable<I, const T2&> &&
                 std::indirect_binary_predicate<std::ranges::equal_to, std::projected<I, Proj>, const T1*>
    constexpr I replace(
        I first,
        S last,
        const T1& old_value,
        const T2& new_value,
        Proj proj = {});
    (2)
  3. template<
        class ExecutionPolicy,
        std::random_access_iterator I,
        std::sized_sentinel_for<I> S,
        class Proj = std::identity,
        class T1 = std::projected_value_t<I, Proj>,
        class T2 = std::iter_value_t<I>>
      requires execution-policy<ExecutionPolicy> && std::indirectly_writable<I, const T2&> &&
                 std::indirect_binary_predicate<std::ranges::equal_to, std::projected<I, Proj>, const T1*>
    decltype(auto) replace(
        ExecutionPolicy&&,
        I first,
        S last,
        const T1& old_value,
        const T2& new_value,
        Proj proj = {}) noexcept;
    (3)
  4. template<
        class ExecutionPolicy,
        sized-random-access-range R,
        class Proj = std::identity,
        class T1 = std::projected_value_t<std::ranges::iterator_t<R>, Proj>,
        class T2 = std::ranges::range_value_t<R>>
      requires execution-policy<ExecutionPolicy> && std::indirectly_writable<std::ranges::iterator_t<R>, const T2&> &&
                 std::indirect_binary_predicate<std::ranges::equal_to, std::projected<std::ranges::iterator_t<R>, Proj>, const T1*>
    decltype(auto) replace(
        ExecutionPolicy&&,
        R&& r,
        const T1& old_value,
        const T2& new_value,
        Proj proj = {}) noexcept;
    (4)