filtered.qbk 1010 B

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:filtered filtered]
  7. [table
  8. [[Syntax] [Code]]
  9. [[Pipe] [`rng | boost::adaptors::filtered(pred)`]]
  10. [[Function] [`boost::adaptors::filter(rng, pred)`]]
  11. ]
  12. * [*Precondition:] The `value_type` of the range is convertible to the argument type of `pred`.
  13. * [*Postcondition:] For all elements `[x]` in the returned range, `pred(x)` is `true`.
  14. * [*Throws:] Whatever the copy constructor of `pred` might throw.
  15. * [*Range Category:] __singlepass_range__
  16. * [*Range Return Type:] `boost::filtered_range<decltype(rng)>`
  17. * [*Returned Range Category:] The minimum of the range category of `rng` and __bidirectional_range__
  18. [section:filtered_example filtered example]
  19. [import ../../../test/adaptor_test/filtered_example.cpp]
  20. [filtered_example]
  21. [endsect]
  22. This would produce the output:
  23. ``
  24. 2,4,6,8,
  25. ``
  26. [endsect]