]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/fusion/test/algorithm/clear.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / fusion / test / algorithm / clear.cpp
CommitLineData
7c673cae
FG
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/sequence/io/out.hpp>
10#include <boost/fusion/sequence/comparison/equal_to.hpp>
11#include <boost/fusion/container/generation/make_vector.hpp>
12#include <boost/fusion/algorithm/transformation/clear.hpp>
13#include <boost/mpl/vector_c.hpp>
14
15int
16main()
17{
18 using namespace boost::fusion;
19
20 std::cout << tuple_open('[');
21 std::cout << tuple_close(']');
22 std::cout << tuple_delimiter(", ");
23
24/// Testing pop_back
25
26 {
27 char const* s = "Ruby";
28 typedef vector<int, char, double, char const*> vector_type;
29 vector_type t1(1, 'x', 3.3, s);
30
31 {
32 std::cout << clear(t1) << std::endl;
33 BOOST_TEST((clear(t1) == make_vector()));
34 }
35 }
36
37 {
38 typedef boost::mpl::vector_c<int, 1, 2, 3, 4, 5> mpl_vec;
39 std::cout << boost::fusion::clear(mpl_vec()) << std::endl;
40 BOOST_TEST((boost::fusion::clear(mpl_vec()) == make_vector()));
41 }
42
43 return boost::report_errors();
44}
45