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

Click here to view the latest version of this page.
PrevUpHomeNext
remove
Description

Returns a new sequence, with all the elements of the original sequence, except those of a given type.

Synopsis
template<
    typename T,
    typename Sequence
    >
typename result_of::remove<Sequence const, T>::type replace(Sequence const& seq);

Table1.59.Parameters

Parameter

Requirement

Description

seq

A model of Forward Sequence

Operation's argument

T

Any type

Type to remove


Expression Semantics
remove<T>(seq);

Return type: A model of Forward Sequence.

Semantics: Returns a new sequence, containing all the elements of seq, in their original order, except those of type T. Equivalent to remove_if<boost::is_same<_,T> >(seq).

Complexity

Constant. Returns a view which is lazily evaluated.

Header
#include <boost/fusion/algorithm/transformation/remove.hpp>
#include <boost/fusion/include/remove.hpp>
Example
const vector<int,double> vec(1,2.0);
assert(remove<double>(vec) == make_vector(1));

PrevUpHomeNext