sliced.qbk 794 B

12345678910111213141516171819202122232425262728293031
  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:sliced sliced]
  7. [table
  8. [[Syntax] [Code]]
  9. [[Pipe] [`rng | boost::adaptors::sliced(n, m)`]]
  10. [[Function] [`boost::adaptors::slice(rng, n, m)`]]
  11. ]
  12. * [*Precondition:] `0 <= n && n <= m && m < distance(rng)`
  13. * [*Returns:] `make_range(rng, n, m)`
  14. * [*Range Category:] __random_access_range__
  15. * [*Range Return Type:] `boost::sliced_range<decltype(rng)>`
  16. * [*Returned Range Category:] __random_access_range__
  17. [section:sliced_example sliced example]
  18. [import ../../../test/adaptor_test/sliced_example.cpp]
  19. [sliced_example]
  20. [endsect]
  21. This would produce the output:
  22. ``
  23. 3,4,5,
  24. ``
  25. [endsect]