cpp/algorithm/replace copy

Copies the elements from the range to another range beginning at, while replacing all elements satisfying specific criteria with. If the source and destination ranges overlap, the behavior is undefined.

@1@ Replaces all elements that are equal to (using ). @3@ Replaces all elements for which predicate returns. @2,4@ Same as, but executed according to.

Return value
Iterator to the element past the last element copied.

Complexity
Given as : @1,2@ exactly comparisons with  using @3,4@ exactly applications of the predicate