filter_view is a view into
a subset of its underlying sequence's elements satisfying a given predicate
(an MPL metafunction).
The filter_view presents
only those elements for which its predicate evaluates to mpl::true_.
#include <boost/fusion/sequence/view/filter_view.hpp>
template <typename Sequence, typename Pred>
struct filter_view;
Notation
- F
-
A filter_view type
- f,
f2
-
Instances of filter_view
- s
-
A Forward
Sequence
Semantics of an expression is defined only where it differs from, or is
not defined in Forward
Sequence.
using boost::mpl::_;
using boost::mpl::not_;
using boost::is_class;
typedef vector<std::string, char, long, bool, double> vector_type;
vector_type v("a-string", '@', 987654, true, 6.6);
filter_view<vector_type const, not_<is_class<_> > > view(v);
std::cout << view << std::endl;