absl::c_copy_n

Container-based version of the <algorithm> std::copy_n() function to copy a container's first N elements into an iterator.

Synopsis

Declared in <absl/algorithm/container.h>

template<
    typename C,
    typename Size,
    typename OutputIterator>
constexpr
/* implementation-defined */
c_copy_n(
    C const& input,
    Size n,
    OutputIterator&& output);

Return Value

An iterator to the end of the copied range in the output.

Parameters

NameDescription
inputThe container whose elements to copy.
nThe number of elements to copy.
outputThe output iterator receiving the copied elements.