]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/fusion/test/algorithm/segmented_for_each.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / fusion / test / algorithm / segmented_for_each.cpp
1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
3 Copyright (c) 2011 Eric Niebler
4
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #include <boost/detail/lightweight_test.hpp>
9 #include <boost/fusion/container/vector/vector.hpp>
10 #include <boost/fusion/algorithm/iteration/for_each.hpp>
11 #include <boost/fusion/container/generation/make_vector.hpp>
12 #include "../sequence/tree.hpp"
13
14 struct print
15 {
16 template <typename T>
17 void operator()(T const& v) const
18 {
19 std::cout << "[ " << v << " ] ";
20 }
21 };
22
23 int
24 main()
25 {
26 using namespace boost::fusion;
27
28 {
29 for_each(
30 make_tree(
31 make_vector(double(0),'B')
32 , make_tree(
33 make_vector(1,2,long(3))
34 , make_tree(make_vector('a','b','c'))
35 , make_tree(make_vector(short('d'),'e','f'))
36 )
37 , make_tree(
38 make_vector(4,5,6)
39 , make_tree(make_vector(float(1),'h','i'))
40 , make_tree(make_vector('j','k','l'))
41 )
42 )
43 , print()
44 );
45 }
46
47 return boost::report_errors();
48 }
49