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)
44 template(typename I, typename O, typename P =
identity)(
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>
The indirectly_copyable concept.
The weakly_incrementable concept.
Definition identity.hpp:25