The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.



Creates a copy of a specified number of elements from an input iterator. The copies are put in a forward iterator.

template<class InputIterator, class Size, class ForwardIterator>
    ForwardIterator uninitialized_copy_n(
        InputIterator _First, 
        Size _Count,
        ForwardIterator _Dest


An input iterator that refers to the object to copy.


A signed or unsigned integer type specifying the number of times to copy the object.


A forward iterator that refers to where the new copies go.

A forward iterator that addresses the first position beyond the destination. If the source range was empty, the iterator addresses _First.

The template function effectively executes the following:

for (; 0 < count; -- count)

new ((void *)&*_Dest++)


return dest;

unless the code throws an exception. In that case, all constructed objects are destroyed and the exception is rethrown.


Header: <memory>

Namespace: std