Brian Silverman | 598d029 | 2018-08-04 23:56:47 -0700 | [diff] [blame^] | 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 remove] |
| 7 | [heading Prototype] |
| 8 | |
| 9 | `` |
| 10 | template< |
| 11 | class ForwardRange, |
| 12 | class Value |
| 13 | > |
| 14 | typename range_iterator<ForwardRange>::type |
| 15 | remove(ForwardRange& rng, const Value& val); |
| 16 | |
| 17 | template< |
| 18 | class ForwardRange, |
| 19 | class Value |
| 20 | > |
| 21 | typename range_iterator<const ForwardRange>::type |
| 22 | remove(const ForwardRange& rng, const Value& val); |
| 23 | |
| 24 | template< |
| 25 | range_return_value re, |
| 26 | class ForwardRange, |
| 27 | class Value |
| 28 | > |
| 29 | typename range_return<ForwardRange,re>::type |
| 30 | remove(ForwardRange& rng, const Value& val); |
| 31 | |
| 32 | template< |
| 33 | range_return_value re, |
| 34 | class ForwardRange, |
| 35 | class Value |
| 36 | > |
| 37 | typename range_return<const ForwardRange,re>::type |
| 38 | remove(const ForwardRange& rng, const Value& val); |
| 39 | `` |
| 40 | |
| 41 | [heading Description] |
| 42 | |
| 43 | `remove` removes from `rng` all of the elements `x` for which `x == val` is `true`. The versions of `remove` that return an iterator, return an iterator `new_last` such that the range `[begin(rng), new_last)` contains no elements equal to `val`. The `range_return` versions of `remove` defines `found` as the new last element. The iterators in the range `[new_last, end(rng))` are dereferenceable, but the elements are unspecified. |
| 44 | |
| 45 | [heading Definition] |
| 46 | |
| 47 | Defined in the header file `boost/range/algorithm/remove.hpp` |
| 48 | |
| 49 | [heading Requirements] |
| 50 | |
| 51 | * `ForwardRange` is a model of the __forward_range__ Concept. |
| 52 | * `ForwardRange` is mutable. |
| 53 | * `Value` is a model of the `EqualityComparableConcept`. |
| 54 | * Objects of type `Value` can be compared for equality with objects of `ForwardRange`'s value type. |
| 55 | |
| 56 | [heading Complexity] |
| 57 | |
| 58 | Linear. `remove` performs exactly `distance(rng)` comparisons for equality. |
| 59 | |
| 60 | [endsect] |