]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/container/test/flat_tree_test.cpp
bump version to 18.2.2-pve1
[ceph.git] / ceph / src / boost / libs / container / test / flat_tree_test.cpp
1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) Copyright Ion Gaztanaga 2004-2013. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // See http://www.boost.org/libs/container for documentation.
8 //
9 //////////////////////////////////////////////////////////////////////////////
10 #include <boost/container/detail/flat_tree.hpp>
11 #include <boost/container/small_vector.hpp>
12 #include <boost/container/stable_vector.hpp>
13 #include <boost/container/static_vector.hpp>
14 #include <boost/static_assert.hpp>
15
16 #include <iostream>
17
18 #include "movable_int.hpp"
19 #include "dummy_test_allocator.hpp"
20 #include <functional> //std::less
21
22 using namespace boost::container;
23
24 typedef boost::container::dtl::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> pair_t;
25
26 namespace boost {
27 namespace container {
28
29 //Explicit instantiation to detect compilation errors
30
31 namespace dtl {
32
33 template class flat_tree
34 < pair_t
35 , select1st<test::movable_and_copyable_int>
36 , std::less<test::movable_and_copyable_int>
37 , test::simple_allocator<pair_t>
38 >;
39
40 template class flat_tree
41 < pair_t
42 , select1st<test::movable_and_copyable_int>
43 , std::less<test::movable_and_copyable_int>
44 , std::allocator<pair_t>
45 >;
46
47 template class flat_tree
48 < pair_t
49 , select1st<test::movable_and_copyable_int>
50 , std::less<test::movable_and_copyable_int>
51 , small_vector<pair_t, 10>
52 >;
53
54 template class flat_tree
55 < pair_t
56 , select1st<test::movable_and_copyable_int>
57 , std::less<test::movable_and_copyable_int>
58 , stable_vector<pair_t>
59 >;
60
61 template class flat_tree
62 < test::movable_and_copyable_int
63 , identity<test::movable_and_copyable_int>
64 , std::less<test::movable_and_copyable_int>
65 , test::simple_allocator<test::movable_and_copyable_int>
66 >;
67
68 template class flat_tree
69 < test::movable_and_copyable_int
70 , identity<test::movable_and_copyable_int>
71 , std::less<test::movable_and_copyable_int>
72 , std::allocator<test::movable_and_copyable_int>
73 >;
74
75 template class flat_tree
76 < test::movable_and_copyable_int
77 , identity<test::movable_and_copyable_int>
78 , std::less<test::movable_and_copyable_int>
79 , small_vector<test::movable_and_copyable_int, 10>
80 >;
81
82 template class flat_tree
83 < test::movable_and_copyable_int
84 , identity<test::movable_and_copyable_int>
85 , std::less<test::movable_and_copyable_int>
86 , stable_vector<test::movable_and_copyable_int>
87 >;
88
89 template class flat_tree
90 < test::movable_and_copyable_int
91 , identity<test::movable_and_copyable_int>
92 , std::less<test::movable_and_copyable_int>
93 , static_vector<test::movable_and_copyable_int, 10>
94 >;
95
96 } //dtl {
97 }} //boost::container
98
99 #if (__cplusplus > 201103L)
100 #include <vector>
101
102 namespace boost{
103 namespace container{
104 namespace dtl{
105
106 template class flat_tree
107 < test::movable_and_copyable_int
108 , identity<test::movable_and_copyable_int>
109 , std::less<test::movable_and_copyable_int>
110 , std::vector<test::movable_and_copyable_int>
111 >;
112
113 template class flat_tree
114 < pair_t
115 , select1st<test::movable_and_copyable_int>
116 , std::less<test::movable_and_copyable_int>
117 , std::vector<pair_t>
118 >;
119
120 } //dtl {
121 }} //boost::container
122
123 #endif
124
125 int main ()
126 {
127 ////////////////////////////////////
128 // has_trivial_destructor_after_move testing
129 ////////////////////////////////////
130 // default
131 {
132 typedef boost::container::dtl::flat_tree<int, boost::container::dtl::identity<int>,
133 std::less<int>, void> tree;
134 typedef tree::container_type container_type;
135 typedef tree::key_compare key_compare;
136 BOOST_STATIC_ASSERT_MSG ((boost::has_trivial_destructor_after_move<tree>::value ==
137 boost::has_trivial_destructor_after_move<container_type>::value &&
138 boost::has_trivial_destructor_after_move<key_compare>::value)
139 , "has_trivial_destructor_after_move(default allocator) test failed");
140 }
141 // std::allocator
142 {
143 typedef boost::container::dtl::flat_tree<int, boost::container::dtl::identity<int>,
144 std::less<int>, std::allocator<int> > tree;
145 typedef tree::container_type container_type;
146 typedef tree::key_compare key_compare;
147 BOOST_STATIC_ASSERT_MSG( (boost::has_trivial_destructor_after_move<tree>::value ==
148 boost::has_trivial_destructor_after_move<container_type>::value &&
149 boost::has_trivial_destructor_after_move<key_compare>::value)
150 , "has_trivial_destructor_after_move(std::allocator) test failed");
151 }
152
153 return 0;
154 }