]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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:remove_if remove_if] | |
7 | ||
8 | [heading Prototype] | |
9 | ||
10 | `` | |
11 | template< | |
12 | class ForwardRange, | |
13 | class UnaryPredicate | |
14 | > | |
15 | typename range_iterator<ForwardRange>::type | |
16 | remove(ForwardRange& rng, UnaryPredicate pred); | |
17 | ||
18 | template< | |
19 | class ForwardRange, | |
20 | class UnaryPredicate | |
21 | > | |
22 | typename range_iterator<const ForwardRange>::type | |
23 | remove(const ForwardRange& rng, UnaryPredicate pred); | |
24 | ||
25 | template< | |
26 | range_return_value re, | |
27 | class ForwardRange, | |
28 | class UnaryPredicate | |
29 | > | |
30 | typename range_return<ForwardRange,re>::type | |
31 | remove(ForwardRange& rng, UnaryPredicate pred); | |
32 | ||
33 | template< | |
34 | range_return_value re, | |
35 | class ForwardRange, | |
36 | class UnaryPredicate | |
37 | > | |
38 | typename range_return<const ForwardRange,re>::type | |
39 | remove(const ForwardRange& rng, UnaryPredicate pred); | |
40 | `` | |
41 | ||
42 | [heading Description] | |
43 | ||
44 | `remove_if` removes from `rng` all of the elements `x` for which `pred(x)` is `true`. The versions of `remove_if` that return an iterator, return an iterator `new_last` such that the range `[begin(rng), new_last)` contains no elements where `pred(x)` is `true`. The iterators in the range `[new_last, end(rng))` are dereferenceable, but the elements are unspecified. | |
45 | ||
46 | [heading Definition] | |
47 | ||
48 | Defined in the header file `boost/range/algorithm/remove_if.hpp` | |
49 | ||
50 | [heading Requirements] | |
51 | ||
52 | * `ForwardRange` is a model of the __forward_range__ Concept. | |
53 | * `ForwardRange` is mutable. | |
54 | * `UnaryPredicate` is a model of the `PredicateConcept`. | |
55 | * `ForwardRange`'s value type is convertible to `UnaryPredicate`'s argument type. | |
56 | ||
57 | [heading Complexity] | |
58 | ||
59 | Linear. `remove_if` performs exactly `distance(rng)` applications of `pred`. | |
60 | ||
61 | [endsect] | |
62 | ||
63 |