...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Returns a new sequence, containing all the elements of the original except those where a given unary function object evaluates to true.
template< typename Pred, typename Sequence > typename result_of::remove_if<Sequence const, Pred>::type remove_if(Sequence const& seq);
Table 1.60. Parameters
Parameter |
Requirement |
Description |
---|---|---|
seq |
A model of Forward Sequence |
Operation's argument |
Pred |
A model of unary MPL Lambda Expression |
Removal predicate |
remove_if<Pred>(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 elements with types for which Pred evaluates to boost::mpl::true_. Equivalent to filter<boost::mpl::not_<Pred> >(seq).
Constant. Returns a view which is lazily evaluated.
#include <boost/fusion/algorithm/transformation/remove_if.hpp> #include <boost/fusion/include/remove_if.hpp>
const vector<int,double> vec(1,2.0); assert(remove_if<is_floating_point<mpl::_> >(vec) == make_vector(1));