absl::c_copy_n

c_copy_n overloads

Synopses

Declared in <absl/algorithm/container.h>

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

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

Copies the first n elements from input to output. absl::c_copy_n(input, n, output) is equivalent to std::copy_n(std::begin(input), n, std::begin(output)).

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

Return Value

  • An iterator to the end of the copied range in the output.
  • This overload returns no value; the results are written into output.

Parameters

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