...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
template< typename Sequence , typename T > struct remove { typedef unspecified type; };
Returns a new sequence which contains all the elements from [begin<Sequence>::type, end<Sequence>::type)
range except those that are identical to T
. The result sequence preserves all the functional and performance characteristics of the original Sequence
, except its size and identity.
#include "boost/mpl/remove.hpp"
Parameter | Requirement | Description |
---|---|---|
Sequence | A model of Extensible Sequence | The original sequence. |
T | A type | A type to be removed. |
Expression | Expression type | Precondition | Semantics | Postcondition |
---|---|---|---|---|
typedef remove<Sequence,T>::type s; | A model of Extensible Sequence | Equivalent to typedef remove_if< Sequence,is_same<_,T> >::type t; . |
Linear. Performs exactly size<Sequence>::type::value
comparisons for equality.
typedef list<int,float,char,float,float,double>::type types; typedef remove< types,float >::type result; typedef list<int,char,double>::type answer; BOOST_STATIC_ASSERT((equal< result,answer >::type::value));
Algorithms, remove_if
, replace
, replace_if
, transform