C++ Standard Library replace_copy() Sample

Description

replace_copy() makes a copy of a sequence of elements, replacing specified values in the copy with new values. The input sequence is unchanged.

Declaration

	template <class In, class Out, class T>
	    Out replace_copy(In, In, Out, const T&, const T&);

Concept

An array of integers is set up, and then a copy of the sequence is made, with the value 3 replaced with the value 2 in the copy. The output is 1 2 2 8 25.

Supported
Supported
Supported