1 .. Sequences/Views//filter_view
26 A view into a subset of ``Sequence``\ 's elements satisfying the predicate ``Pred``.
34 #include <boost/mpl/filter_view.hpp>
46 +---------------+-----------------------------------+-----------------------------------------------+
47 | Parameter | Requirement | Description |
48 +===============+===================================+===============================================+
49 | ``Sequence`` | |Forward Sequence| | A sequence to wrap. |
50 +---------------+-----------------------------------+-----------------------------------------------+
51 | ``Pred`` | Unary |Lambda Expression| | A filtering predicate. |
52 +---------------+-----------------------------------+-----------------------------------------------+
58 Semantics of an expression is defined only where it differs from, or is not
59 defined in |Forward Sequence|.
61 In the following table, ``v`` is an instance of ``filter_view``, ``s`` is an arbitrary
62 |Forward Sequence|, ``pred`` is an unary |Lambda Expression|.
64 +---------------------------------------+-----------------------------------------------------------+
65 | Expression | Semantics |
66 +=======================================+===========================================================+
67 | .. parsed-literal:: | A lazy |Forward Sequence| sequence of all the elements in |
68 | | the range |begin/end<s>| that satisfy the predicate |
69 | filter_view<s,pred> | ``pred``. |
70 | filter_view<s,pred>::type | |
71 +---------------------------------------+-----------------------------------------------------------+
72 | ``size<v>::type`` | The size of ``v``; |
73 | | ``size<v>::value == count_if<s,pred>::value``; |
74 | | linear complexity; see |Forward Sequence|. |
75 +---------------------------------------+-----------------------------------------------------------+
81 Find the largest floating type in a sequence.
85 typedef vector<int,float,long,float,char[50],long double,char> types;
87 transform_view< filter_view< types,boost::is_float<_> >, size_of<_> >
90 BOOST_MPL_ASSERT(( is_same< deref<iter::base>::type, long double > ));
96 |Sequences|, |Views|, |transform_view|, |joint_view|, |zip_view|, |iterator_range|
99 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
100 Distributed under the Boost Software License, Version 1.0. (See accompanying
101 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)