Container‐based version of the <algorithm> std::replace_if() function to replace a container's elements of some value with a new value based on some condition. The container is modified in place.

Synopsis

Declared in <absl/algorithm/container.h>

template<
    typename C,
    typename Pred,
    typename T>
constexpr
void
c_replace_if(
    C& c,
    Pred&& pred,
    T&& new_value);

Parameters

Name

Description

c

The container to modify.

pred

The predicate selecting which elements to replace.

new_value

The value to substitute for matching elements.

Created with MrDocs