1
2// Copyright Aleksey Gurtovoy 2001-2004
3//
4// Distributed under the Boost Software License,Version 1.0.
5// (See accompanying file LICENSE_1_0.txt or copy at
6// http://www.boost.org/LICENSE_1_0.txt)
7//
8// See http://www.boost.org/libs/mpl for documentation.
9
10// $Id$
11// $Date$
12// $Revision$
13
14#include <boost/static_assert.hpp>
15#include <boost/mpl/filter_view.hpp>
16#include <boost/mpl/transform_view.hpp>
17#include <boost/mpl/max_element.hpp>
18#include <boost/mpl/list.hpp>
19#include <boost/mpl/sizeof.hpp>
20#include <boost/mpl/deref.hpp>
21#include <boost/mpl/equal.hpp>
22#include <boost/mpl/aux_/test.hpp>
23
24#include <boost/type_traits/is_float.hpp>
25#include <boost/type_traits/is_same.hpp>
26
27MPL_TEST_CASE()
28{
29 typedef mpl::list<int,float,long,float,char[50],long double,char> types;
30 typedef mpl::list<float,float,long double> floats;
31
32 MPL_ASSERT(( equal< mpl::filter_view< types,boost::is_float<_> >::type,floats > ));
33
34 typedef mpl::max_element<
35 mpl::transform_view<
36 mpl::filter_view< types,boost::is_float<_> >
37 , mpl::sizeof_<_>
38 >
39 >::type iter;
40
41 MPL_ASSERT((is_same<mpl::deref<iter::base>::type, long double>));
42}
43

source code of boost/libs/mpl/test/filter_view.cpp