copy_n.qbk 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. [heading Prototype]
  8. ``
  9. template<class SinglePassRange, class Size, class OutputIterator>
  10. OutputIterator copy_n(const SinglePassRange& rng, Size n, OutputIterator out);
  11. ``
  12. [heading Description]
  13. `copy_n` is provided to completely replicate the standard algorithm header,
  14. it is preferable to use Range Adaptors and the extension functions to achieve
  15. the same result with greater safety.
  16. `copy_n` copies elements from `[boost::begin(rng), boost::begin(rng) + n)` to the range `[out, out + n)`
  17. [heading Definition]
  18. Defined in the header file `boost/range/algorithm_ext/copy_n.hpp`
  19. [heading Requirements]
  20. # `SinglePassRange` is a model of the __single_pass_range__ Concept.
  21. # `Size` is a model of the `Integer` Concept.
  22. # `OutputIterator` is a model of the `OutputIteratorConcept`.
  23. [heading Complexity]
  24. Linear. Exactly `n` elements are copied.
  25. [endsect]