[#absl-c_replace_copy]
= xref:absl.adoc[absl]::c&lowbar;replace&lowbar;copy
:relfileprefix: ../
:mrdocs:

Container&hyphen;based version of the &lt;algorithm&gt; `std&colon;&colon;replace&lowbar;copy()` function to replace a container&apos;s elements of some value with a new value and return the results within an iterator&period;

== Synopsis

Declared in `&lt;absl&sol;algorithm&sol;container&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename C,
    typename OutputIterator,
    typename T&gt;
constexpr
OutputIterator
c&lowbar;replace&lowbar;copy(
    C const& c,
    OutputIterator result,
    T&& old&lowbar;value,
    T&& new&lowbar;value);
----

== Return Value

An iterator to the end of the copied range in the output&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *c*
| The container whose elements to copy&period;
| *result*
| The output iterator receiving the copied elements&period;
| *old&lowbar;value*
| The value to be replaced&period;
| *new&lowbar;value*
| The value to substitute for `old&lowbar;value`&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
