copy

Copies the elements in the range [first, last), to another range begining at d_first.

template<class InputIt, class OutputIt>
OutputIt copy(InputIt first, InputIt last, OutputIt d_first);

The behaviour of the copy is equivalent to:

template<class InputIt, class OutputIt>
OutputIt copy(InputIt first, InputIt last, OutputIt d_first)
{
    while ( first != last) {
        *d_first = *first;
        first++;
        d_first++;
    }
    return d_first;
}

The behaviour is undefined if d_first is in the range [first, last).