erase.qbk 1011 B

12345678910111213141516171819202122232425262728293031323334353637
  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:erase erase]
  7. [heading Prototype]
  8. ``
  9. template<class Container>
  10. Container& erase(
  11. Container& target,
  12. iterator_range<typename Container::iterator> to_erase);
  13. ``
  14. [heading Description]
  15. `erase` the iterator range `to_erase` from the container `target`.
  16. `remove_erase` performs the frequently used combination equivalent to `target.erase(std::remove(target.begin(), target.end(), value), target.end());`
  17. `remove_erase_if` performs the frequently used combination equivalent to `target.erase(std::remove_if(target.begin(), target.end(), pred), target.end());`
  18. [heading Definition]
  19. Defined in the header file `boost/range/algorithm_ext/erase.hpp`
  20. [heading Requirements]
  21. # `Container` supports erase of an iterator range.
  22. [heading Complexity]
  23. Linear. Proprotional to `distance(to_erase)`.
  24. [endsect]