source:
downloads/boost_1_33_1/libs/mpl/doc/src/refmanual/remove.rst
@
12
Last change on this file since 12 was 12, checked in by landauf, 18 years ago | |
---|---|
File size: 2.3 KB |
remove
Synopsis
template< typename Sequence , typename T , typename In = |unspecified| > struct remove { typedef |unspecified| type; };
Description
Returns a new sequence that contains all elements from |begin/end<Sequence>| range except those that are identical to T.
Header
#include <boost/mpl/remove.hpp>
Model of
Parameters
Parameter | Requirement | Description |
---|---|---|
Sequence | |Forward Sequence| | An original sequence. |
T | Any type | A type to be removed. |
In | |Inserter| | An inserter. |
Expression semantics
|Semantics disclaimer...| |Reversible Algorithm|.
For any |Forward Sequence| s, an |Inserter| in, and arbitrary type x:
typedef remove<s,x,in>::type r;
Return type: | A type. |
---|---|
Semantics: | Equivalent to typedef remove_if< s,is_same<_,x>,in >::type r; |
Complexity
Linear. Performs exactly size<s>::value comparisons for equality, and at most size<s>::value insertions.
Example
typedef vector<int,float,char,float,float,double>::type types; typedef remove< types,float >::type result; BOOST_MPL_ASSERT(( equal< result, vector<int,char,double> > ));
Note: See TracBrowser
for help on using the repository browser.