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

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;

== Synopsis

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

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

== Description

The `output` container must be large enough to hold N elements&semi; this function does not resize `output`&period;

If `n &gt; std&colon;&colon;size(output)` or `n &gt; std&colon;&colon;size(input)`, behavior is undefined&period; If `std&colon;&colon;size(output) &gt; n`, only `n` elements are copied, and `output` is not truncated&period;

== Return Value

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 destination container receiving the copied elements&period;
|===


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