Daily bit(e) of C++ | std::replace, std::replace_if
Daily bit(e) of C++ #199, The two element replacement algorithms: std::replace and std::replace_if.
The two algorithms, std::replace and std::replace_if, will replace elements of a range that match the provided value or predicate with a new provided value.
Both algorithms are constexpr enabled (C++20) and have parallel (C++17) and range (C++20) variants.