libycxx

function object

std::ranges::replace_if

Scope
std::ranges

Synopsis

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

Call signatures

replace_if 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 T = std::ranges::range_value_t<R>,
        std::indirect_unary_predicate<std::projected<iterator_t<R>, Proj>> Pred>
      requires std::indirectly_writable<iterator_t<R>, const T&>
    constexpr borrowed_iterator_t<R> replace_if(
        R&& r,
        Pred pred,
        const T& new_value,
        Proj proj = {});
    (1)
  2. template<
        std::input_iterator I,
        std::sentinel_for<I> S,
        class Proj = std::identity,
        class T = std::iter_value_t<I>,
        std::indirect_unary_predicate<std::projected<I, Proj>> Pred>
      requires std::indirectly_writable<I, const T&>
    constexpr I replace_if(
        I first,
        S last,
        Pred pred,
        const T& 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 T = std::iter_value_t<I>,
        std::indirect_unary_predicate<std::projected<I, Proj>> Pred>
      requires execution-policy<ExecutionPolicy> && std::indirectly_writable<I, const T&>
    decltype(auto) replace_if(
        ExecutionPolicy&&,
        I first,
        S last,
        Pred pred,
        const T& new_value,
        Proj proj = {}) noexcept;
    (3)
  4. template<
        class ExecutionPolicy,
        sized-random-access-range R,
        class Proj = std::identity,
        class T = std::ranges::range_value_t<R>,
        std::indirect_unary_predicate<std::projected<std::ranges::iterator_t<R>, Proj>> Pred>
      requires execution-policy<ExecutionPolicy> && std::indirectly_writable<std::ranges::iterator_t<R>, const T&>
    decltype(auto) replace_if(
        ExecutionPolicy&&,
        R&& r,
        Pred pred,
        const T& new_value,
        Proj proj = {}) noexcept;
    (4)