cpp/algorithm/copy

Copies the elements in the range, defined by, to another range beginning at. @1@ Copies all elements in the range starting from first and proceeding to. The behavior is undefined if is within the range. In this case, std may be used instead.

@3@ Only copies the elements for which the predicate returns. The relative order of the elements that are copied is preserved. The behavior is undefined if the source and the destination ranges overlap.

@2,4@ Same as, but executed according to.

Return value
Output iterator to the element in the destination range, one past the last element copied.

Complexity
@1-2@ Exactly assignments.

@3-4@ Exactly applications of the predicate, between  and  assignments (assignment for every element for which predicate is equal to true, dependent on predicate and input data).

For the overloads with an ExecutionPolicy, there may be a performance cost if 's value type is not.