]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [/ |
2 | Copyright 2010 Neil Groves | |
3 | Distributed under the Boost Software License, Version 1.0. | |
4 | (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
5 | /] | |
6 | [section:copy_n copy_n] | |
7 | ||
8 | [heading Prototype] | |
9 | ||
10 | `` | |
11 | template<class SinglePassRange, class Size, class OutputIterator> | |
12 | OutputIterator copy_n(const SinglePassRange& rng, Size n, OutputIterator out); | |
13 | `` | |
14 | ||
15 | [heading Description] | |
16 | ||
17 | `copy_n` is provided to completely replicate the standard algorithm header, | |
18 | it is preferable to use Range Adaptors and the extension functions to achieve | |
19 | the same result with greater safety. | |
20 | ||
21 | `copy_n` copies elements from `[boost::begin(rng), boost::begin(rng) + n)` to the range `[out, out + n)` | |
22 | ||
23 | [heading Definition] | |
24 | ||
25 | Defined in the header file `boost/range/algorithm_ext/copy_n.hpp` | |
26 | ||
27 | [heading Requirements] | |
28 | ||
29 | # `SinglePassRange` is a model of the __single_pass_range__ Concept. | |
30 | # `Size` is a model of the `Integer` Concept. | |
31 | # `OutputIterator` is a model of the `OutputIteratorConcept`. | |
32 | ||
33 | [heading Complexity] | |
34 | ||
35 | Linear. Exactly `n` elements are copied. | |
36 | ||
37 | [endsect] |