]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mpl/test/list.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/list.hpp>
15 #include <boost/mpl/push_front.hpp>
16 #include <boost/mpl/pop_front.hpp>
17 #include <boost/mpl/front.hpp>
18 #include <boost/mpl/size.hpp>
19 #include <boost/mpl/empty.hpp>
21 #include <boost/mpl/aux_/test.hpp>
27 typedef list1
<char> l1
;
28 typedef list2
<char,long> l2
;
29 typedef list9
<char,char,char,char,char,char,char,char,char> l9
;
31 MPL_ASSERT_RELATION(size
<l0
>::value
, ==, 0);
32 MPL_ASSERT_RELATION(size
<l1
>::value
, ==, 1);
33 MPL_ASSERT_RELATION(size
<l2
>::value
, ==, 2);
34 MPL_ASSERT_RELATION(size
<l9
>::value
, ==, 9);
36 MPL_ASSERT(( empty
<l0
> ));
37 MPL_ASSERT_NOT(( empty
<l1
> ));
38 MPL_ASSERT_NOT(( empty
<l2
> ));
39 MPL_ASSERT_NOT(( empty
<l9
> ));
41 MPL_ASSERT(( is_same
<front
<l1
>::type
,char> ));
42 MPL_ASSERT(( is_same
<front
<l2
>::type
,char> ));
43 MPL_ASSERT(( is_same
<front
<l9
>::type
,char> ));
48 typedef list2
<char,long> l2
;
50 typedef begin
<l2
>::type i1
;
51 typedef next
<i1
>::type i2
;
52 typedef next
<i2
>::type i3
;
54 MPL_ASSERT(( is_same
<deref
<i1
>::type
,char> ));
55 MPL_ASSERT(( is_same
<deref
<i2
>::type
,long> ));
56 MPL_ASSERT(( is_same
< i3
, end
<l2
>::type
> ));
63 typedef push_front
<l0
,char>::type l1
;
64 MPL_ASSERT(( is_same
<front
<l1
>::type
,char> ));
66 typedef push_front
<l1
,long>::type l2
;
67 MPL_ASSERT(( is_same
<front
<l2
>::type
,long> ));