<<<<<<< .working ======= >>>>>>> .merge-right.r57125
Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
<<<<<<< .working

filter_view

Description

=======
Description
>>>>>>> .merge-right.r57125

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_.

<<<<<<< .working

Header

=======
Header
>>>>>>> .merge-right.r57125
#include <boost/fusion/view/filter_view.hpp>
#include <boost/fusion/include/filter_view.hpp>
<<<<<<< .working

Synopsis

=======
Synopsis
>>>>>>> .merge-right.r57125
template <typename Sequence, typename Pred>
struct filter_view;
<<<<<<< .working

Template parameters

=======
Template parameters
>>>>>>> .merge-right.r57125

Parameter

Description

Default

Sequence

A Forward Sequence

Pred

Unary Metafunction returning an mpl::bool_

<<<<<<< .working

Model of

=======
Model of
>>>>>>> .merge-right.r57125

Notation

F

A filter_view type

f, f2

Instances of filter_view

s

A Forward Sequence

<<<<<<< .working

Expression Semantics

=======
Expression Semantics
>>>>>>> .merge-right.r57125

Semantics of an expression is defined only where it differs from, or is not <<<<<<< .working defined in Forward Sequence. ======= defined in the implemented models. >>>>>>> .merge-right.r57242

Expression

Semantics

F(s)

Creates a filter_view given a sequence, s.

F(f)

Copy constructs a filter_view from another filter_view, f.

f = f2

Assigns to a filter_view, f, from another filter_view, f2.

<<<<<<< .working

Example

=======
Example
>>>>>>> .merge-right.r57125
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;

PrevUpHomeNext