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