2 Copyright (c) Marshall Clow 2011-2012.
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 /// \brief Copy n items from one sequence to another
10 /// \author Marshall Clow
12 #ifndef BOOST_ALGORITHM_COPY_N_HPP
13 #define BOOST_ALGORITHM_COPY_N_HPP
15 namespace boost { namespace algorithm {
17 /// \fn copy_n ( InputIterator first, Size n, OutputIterator result )
18 /// \brief Copies exactly n (n > 0) elements from the range starting at first to
19 /// the range starting at result.
20 /// \return The updated output iterator
22 /// \param first The start of the input sequence
23 /// \param n The number of elements to copy
24 /// \param result An output iterator to write the results into
25 /// \note This function is part of the C++2011 standard library.
26 template <typename InputIterator, typename Size, typename OutputIterator>
27 OutputIterator copy_n ( InputIterator first, Size n, OutputIterator result )
29 for ( ; n > 0; --n, ++first, ++result )
33 }} // namespace boost and algorithm
35 #endif // BOOST_ALGORITHM_COPY_IF_HPP