[#absl-c_copy_n-03]
= xref:absl.adoc[absl]::c&lowbar;copy&lowbar;n
:relfileprefix: ../
:mrdocs:

`c&lowbar;copy&lowbar;n` overloads

== Synopses

Declared in `&lt;absl&sol;algorithm&sol;container&period;h&gt;`

Container&hyphen;based version of the &lt;algorithm&gt; `std&colon;&colon;copy&lowbar;n()` function to copy a container&apos;s first N elements into an iterator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename C,
    typename Size,
    typename OutputIterator&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
xref:absl/c_copy_n-01.adoc[c&lowbar;copy&lowbar;n](
    C const& input,
    Size n,
    OutputIterator&& output);
----

[.small]#xref:absl/c_copy_n-01.adoc[_» more&period;&period;&period;_]#

Copies the first `n` elements from `input` to `output`&period; `absl&colon;&colon;c&lowbar;copy&lowbar;n(input, n, output)` is equivalent to `std&colon;&colon;copy&lowbar;n(std&colon;&colon;begin(input), n, std&colon;&colon;begin(output))`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename C,
    typename Size,
    typename OutputRange&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
xref:absl/c_copy_n-07.adoc[c&lowbar;copy&lowbar;n](
    C const& input,
    Size n,
    OutputRange&& output);
----

[.small]#xref:absl/c_copy_n-07.adoc[_» more&period;&period;&period;_]#

== Return Value

* An iterator to the end of the copied range in the output&period;
* This overload returns no value&semi; the results are written into `output`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *input*
| The container whose elements to copy&period;
| *n*
| The number of elements to copy&period;
| *output*
| The output iterator receiving the copied elements&period;
|===


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