]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mpl/test/erase.cpp
2 // Copyright Aleksey Gurtovoy 2000-2004
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)
8 // See http://www.boost.org/libs/mpl for documentation.
14 #include <boost/mpl/erase.hpp>
15 #include <boost/mpl/list.hpp>
16 #include <boost/mpl/list_c.hpp>
17 #include <boost/mpl/find.hpp>
18 #include <boost/mpl/size.hpp>
19 #include <boost/mpl/integral_c.hpp>
20 #include <boost/mpl/begin_end.hpp>
21 #include <boost/mpl/aux_/test.hpp>
25 typedef list
<int,char,long,short,char,long,double,long> types
;
26 typedef find
<types
,short>::type iter
;
28 typedef erase
<types
, iter
>::type result
;
29 MPL_ASSERT_RELATION( size
<result
>::value
, ==, 7 );
31 typedef find
<result
,short>::type result_iter
;
32 MPL_ASSERT(( is_same
< result_iter
, end
<result
>::type
> ));
37 typedef list_c
<int,1,0,5,1,7,5,0,5> values
;
38 typedef find
< values
, integral_c
<int,7> >::type iter
;
40 typedef erase
<values
, iter
>::type result
;
41 MPL_ASSERT_RELATION( size
<result
>::value
, ==, 7 );
43 typedef find
<result
, integral_c
<int,7> >::type result_iter
;
44 MPL_ASSERT(( is_same
< result_iter
, end
<result
>::type
> ));