Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Function template erase_if
PrevUpHomeNext

Function template erase_if

boost::container::erase_if

Synopsis

// In header: <boost/container/hub.hpp>


template<typename T, typename Allocator, typename Predicate> 
  hub< T, Allocator >::size_type 
  erase_if(hub< T, Allocator > & x, Predicate pred);

Description

Effects: Erases all elements of x for which pred returns true.

Returns: The number of erased elements.

Complexity: Linear in x.size().

Note: Potentially faster than the naive erase loop due to internal optimizations.


PrevUpHomeNext