13 #ifndef RANGES_V3_ALGORITHM_COPY_N_HPP
14 #define RANGES_V3_ALGORITHM_COPY_N_HPP
22 #include <range/v3/algorithm/result_types.hpp>
30 #include <range/v3/utility/static_const.hpp>
32 #include <range/v3/detail/prologue.hpp>
38 template<
typename I,
typename O>
39 using copy_n_result = detail::in_out_result<I, O>;
41 RANGES_FUNC_BEGIN(copy_n)
47 constexpr copy_n_result<I, O> RANGES_FUNC(copy_n)(I
first, iter_difference_t<I> n, O out)
49 RANGES_EXPECT(0 <= n);
51 auto b = uncounted(
first);
52 for(; n != 0; ++b, ++out, --n)
54 return {recounted(
first, b, norig), out};
57 RANGES_FUNC_END(copy_n)
62 using ranges::copy_n_result;
67 #include <range/v3/detail/epilogue.hpp>
template(typename I, typename O, typename P=identity)(requires input_iterator< I > AND weakly_incrementable< O > AND indirectly_copyable< I
function template copy_n
CPP_concept input_iterator
\concept input_iterator
Definition: concepts.hpp:362
CPP_concept indirectly_copyable
\concept indirectly_copyable
Definition: concepts.hpp:782
CPP_concept weakly_incrementable
\concept weakly_incrementable
Definition: concepts.hpp:268
front< Pair > first
Retrieve the first element of the pair Pair.
Definition: meta.hpp:2251
Definition: identity.hpp:25