9
3

transformed.qbk 1.1 KB

1234567891011121314151617181920212223242526272829303132
  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:transformed transformed]
  7. [table
  8. [[Syntax] [Code]]
  9. [[Pipe] [`rng | boost::adaptors::transformed(fun)`]]
  10. [[Function] [`boost::adaptors::transform(rng, fun)`]]
  11. ]
  12. * [*Precondition:] The `value_type` of the range is convertible to the argument type of `fun`.
  13. * [*Postcondition:] For all elements `x` in the returned range, `x` is the result of `fun(y)` where `y` is the corresponding element in the original range.
  14. * [*Throws:] Whatever the copy-constructor of `fun` might throw.
  15. * [*Range Category:] __single_pass_range__
  16. * [*Range Return Type:] `boost::transformed_range<decltype(rng)>`
  17. * [*Returned Range Category:] The range category of `rng`.
  18. [section:transformed_example transformed example]
  19. [import ../../../test/adaptor_test/transformed_example.cpp]
  20. [transformed_example]
  21. [endsect]
  22. This would produce the output:
  23. ``
  24. 2,4,6,8,10,12,14,16,18,20,
  25. ``
  26. [endsect]