[#BloombergLP-bslstl-AlgorithmUtil-copyN]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/AlgorithmUtil.adoc[AlgorithmUtil]::copyN
:relfileprefix: ../../../
:mrdocs:

Copy a counted range of elements to an output iterator&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;algorithm&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;INPUT&lowbar;ITERATOR,
    class t&lowbar;SIZE,
    class t&lowbar;OUTPUT&lowbar;ITERATOR&gt;
static
t&lowbar;OUTPUT&lowbar;ITERATOR
copyN(
    t&lowbar;INPUT&lowbar;ITERATOR first,
    t&lowbar;SIZE count,
    t&lowbar;OUTPUT&lowbar;ITERATOR result);
----

== Description

Copy the specified `count` elements from the specified `first` to the specified `result`&period; Return an iterator pointing past the last copied element in the output range&period;

== Return Value

iterator pointing past the last copied element in the output range

== Parameters

[cols="1,4"]
|===
| Name| Description
| *first*
| beginning of the range to copy from
| *count*
| number of elements to copy
| *result*
| beginning of the destination range
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
