]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/fusion/test/algorithm/remove.cpp
1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #include <boost/detail/lightweight_test.hpp>
8 #include <boost/fusion/container/vector/vector.hpp>
9 #include <boost/fusion/adapted/mpl.hpp>
10 #include <boost/fusion/sequence/io/out.hpp>
11 #include <boost/fusion/container/generation/make_vector.hpp>
12 #include <boost/fusion/sequence/comparison/equal_to.hpp>
13 #include <boost/fusion/algorithm/transformation/remove.hpp>
14 #include <boost/mpl/vector.hpp>
18 operator char const*() const
26 operator char const*() const
35 using namespace boost::fusion
;
36 using boost::mpl::identity
;
37 using boost::mpl::vector
;
38 namespace fusion
= boost::fusion
;
40 std::cout
<< tuple_open('[');
41 std::cout
<< tuple_close(']');
42 std::cout
<< tuple_delimiter(", ");
47 typedef fusion::vector
<Y
, char, long, X
, bool, double> vector_type
;
48 vector_type
t(y
, '@', 987654, x
, true, 6.6);
51 std::cout
<< fusion::remove
<X
>(t
) << std::endl
;
52 BOOST_TEST((fusion::remove
<X
>(t
)
53 == make_vector(y
, '@', 987654, true, 6.6)));
57 std::cout
<< fusion::remove
<Y
>(t
) << std::endl
;
58 BOOST_TEST((fusion::remove
<Y
>(t
)
59 == make_vector('@', 987654, x
, true, 6.6)));
63 std::cout
<< fusion::remove
<long>(t
) << std::endl
;
64 BOOST_TEST((fusion::remove
<long>(t
)
65 == make_vector(y
, '@', x
, true, 6.6)));
69 typedef vector
<Y
, char, long, X
, bool> mpl_vec
;
70 BOOST_TEST((fusion::remove
<X
>(mpl_vec())
71 == vector
<Y
, char, long, bool>()));
72 BOOST_TEST((fusion::remove
<Y
>(mpl_vec())
73 == vector
<char, long, X
, bool>()));
74 BOOST_TEST((fusion::remove
<long>(mpl_vec())
75 == vector
<Y
, char, X
, bool>()));
78 return boost::report_errors();