1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
3
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/sequence/comparison/equal_to.hpp>
12 #include <boost/fusion/container/generation/make_vector.hpp>
13 #include <boost/fusion/algorithm/transformation/pop_front.hpp>
14 #include <boost/mpl/vector_c.hpp>
15
16 int
main()17 main()
18 {
19 using namespace boost::fusion;
20
21 std::cout << tuple_open('[');
22 std::cout << tuple_close(']');
23 std::cout << tuple_delimiter(", ");
24
25 /// Testing pop_front
26
27 {
28 char const* s = "Ruby";
29 typedef vector<int, char, double, char const*> vector_type;
30 vector_type t1(1, 'x', 3.3, s);
31
32 {
33 std::cout << pop_front(t1) << std::endl;
34 BOOST_TEST((pop_front(t1) == make_vector('x', 3.3, s)));
35 }
36 }
37
38 {
39 typedef boost::mpl::vector_c<int, 1, 2, 3, 4, 5> mpl_vec;
40 std::cout << boost::fusion::pop_front(mpl_vec()) << std::endl;
41 BOOST_TEST((boost::fusion::pop_front(mpl_vec()) == make_vector(2, 3, 4, 5)));
42 }
43
44 return boost::report_errors();
45 }
46
47