The replace_copy() algorithm leaves the original sequence intact and places the revised sequence into result. For the range [start, finish), the algorithm compares elements referred to by iterator i with old_value. If *i does not compare equal to old_value, then replace_copy() copies *i to result+(start-i). If *i==old_value, then replace_copy() copies new_value to result+(start-i). replace_copy() returns result+(finish-start).