remove.qbk 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. template<
  10. class ForwardRange,
  11. class Value
  12. >
  13. typename range_iterator<ForwardRange>::type
  14. remove(ForwardRange& rng, const Value& val);
  15. template<
  16. class ForwardRange,
  17. class Value
  18. >
  19. typename range_iterator<const ForwardRange>::type
  20. remove(const ForwardRange& rng, const Value& val);
  21. template<
  22. range_return_value re,
  23. class ForwardRange,
  24. class Value
  25. >
  26. typename range_return<ForwardRange,re>::type
  27. remove(ForwardRange& rng, const Value& val);
  28. template<
  29. range_return_value re,
  30. class ForwardRange,
  31. class Value
  32. >
  33. typename range_return<const ForwardRange,re>::type
  34. remove(const ForwardRange& rng, const Value& val);
  35. ``
  36. [heading Description]
  37. `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.
  38. [heading Definition]
  39. Defined in the header file `boost/range/algorithm/remove.hpp`
  40. [heading Requirements]
  41. * `ForwardRange` is a model of the __forward_range__ Concept.
  42. * `ForwardRange` is mutable.
  43. * `Value` is a model of the `EqualityComparableConcept`.
  44. * Objects of type `Value` can be compared for equality with objects of `ForwardRange`'s value type.
  45. [heading Complexity]
  46. Linear. `remove` performs exactly `distance(rng)` comparisons for equality.
  47. [endsect]