]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/container/test/flat_map_test.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / container / test / flat_map_test.cpp
index f5caff7acbfbc1735849cf2333b754ee3474d0d7..bb0f9137afb2aeb57a3ad67d297a698b523aedca 100644 (file)
@@ -7,10 +7,9 @@
 // See http://www.boost.org/libs/container for documentation.
 //
 //////////////////////////////////////////////////////////////////////////////
-#include <boost/container/detail/config_begin.hpp>
-
 #include <vector>
 
+#include <boost/static_assert.hpp>
 #include <boost/container/flat_map.hpp>
 #include <boost/container/allocator.hpp>
 #include <boost/container/detail/container_or_allocator_rebind.hpp>
@@ -769,70 +768,56 @@ int main()
          typedef boost::container::new_allocator<value_t> alloc_or_cont_t;
          typedef boost::container::flat_map<int, int> cont;
          typedef boost::container::dtl::flat_tree<value_t, key_of_value_t, std::less<int>, alloc_or_cont_t> tree;
-         if (boost::has_trivial_destructor_after_move<cont>::value !=
-             boost::has_trivial_destructor_after_move<tree>::value) {
-            std::cerr << "has_trivial_destructor_after_move(flat_map, default) test failed" << std::endl;
-            return 1;
-         }
+         BOOST_STATIC_ASSERT_MSG( boost::has_trivial_destructor_after_move<cont>::value ==
+                                  boost::has_trivial_destructor_after_move<tree>::value
+                                , "has_trivial_destructor_after_move(flat_map, default) test failed");
       }
       // flat_map, vector
       {
          typedef boost::container::vector<value_t> alloc_or_cont_t;
          typedef boost::container::flat_map<int, int, std::less<int>, alloc_or_cont_t> cont;
          typedef boost::container::dtl::flat_tree<value_t, key_of_value_t, std::less<int>, alloc_or_cont_t> tree;
-         if (boost::has_trivial_destructor_after_move<cont>::value !=
-             boost::has_trivial_destructor_after_move<tree>::value) {
-            std::cerr << "has_trivial_destructor_after_move(flat_map, vector) test failed" << std::endl;
-            return 1;
-         }
+         BOOST_STATIC_ASSERT_MSG( boost::has_trivial_destructor_after_move<cont>::value ==
+                                  boost::has_trivial_destructor_after_move<tree>::value
+                                , "has_trivial_destructor_after_move(flat_map, vector) test failed");
       }
       // flat_map, std::vector
       {
          typedef std::vector<value_t> alloc_or_cont_t;
          typedef boost::container::flat_map<int, int, std::less<int>, alloc_or_cont_t> cont;
          typedef boost::container::dtl::flat_tree<value_t, key_of_value_t, std::less<int>, alloc_or_cont_t> tree;
-         if (boost::has_trivial_destructor_after_move<cont>::value !=
-             boost::has_trivial_destructor_after_move<tree>::value) {
-            std::cerr << "has_trivial_destructor_after_move(flat_map, std::vector) test failed" << std::endl;
-            return 1;
-         }
+         BOOST_STATIC_ASSERT_MSG( boost::has_trivial_destructor_after_move<cont>::value ==
+                                  boost::has_trivial_destructor_after_move<tree>::value
+                                , "has_trivial_destructor_after_move(flat_map, std::vector) test failed");
       }
       // flat_multimap, default
       {
          typedef boost::container::new_allocator<value_t> alloc_or_cont_t;
          typedef boost::container::flat_multimap<int, int> cont;
          typedef boost::container::dtl::flat_tree<value_t, key_of_value_t, std::less<int>, alloc_or_cont_t> tree;
-         if (boost::has_trivial_destructor_after_move<cont>::value !=
-             boost::has_trivial_destructor_after_move<tree>::value) {
-            std::cerr << "has_trivial_destructor_after_move(flat_multimap, default) test failed" << std::endl;
-            return 1;
-         }
+         BOOST_STATIC_ASSERT_MSG( boost::has_trivial_destructor_after_move<cont>::value ==
+                                  boost::has_trivial_destructor_after_move<tree>::value
+                                , "has_trivial_destructor_after_move(flat_multimap, default) test failed");
       }
       // flat_multimap, vector
       {
          typedef boost::container::vector<value_t> alloc_or_cont_t;
          typedef boost::container::flat_multimap<int, int, std::less<int>, alloc_or_cont_t> cont;
          typedef boost::container::dtl::flat_tree<value_t, key_of_value_t, std::less<int>, alloc_or_cont_t> tree;
-         if (boost::has_trivial_destructor_after_move<cont>::value !=
-             boost::has_trivial_destructor_after_move<tree>::value) {
-            std::cerr << "has_trivial_destructor_after_move(flat_multimap, vector) test failed" << std::endl;
-            return 1;
-         }
+         BOOST_STATIC_ASSERT_MSG( boost::has_trivial_destructor_after_move<cont>::value ==
+                                  boost::has_trivial_destructor_after_move<tree>::value
+                                , "has_trivial_destructor_after_move(flat_multimap, vector) test failed");
       }
       // flat_multimap, std::vector
       {
          typedef std::vector<value_t> alloc_or_cont_t;
          typedef boost::container::flat_multimap<int, int, std::less<int>, alloc_or_cont_t> cont;
          typedef boost::container::dtl::flat_tree<value_t, key_of_value_t, std::less<int>, alloc_or_cont_t> tree;
-         if (boost::has_trivial_destructor_after_move<cont>::value !=
-             boost::has_trivial_destructor_after_move<tree>::value) {
-            std::cerr << "has_trivial_destructor_after_move(flat_multimap, std::vector) test failed" << std::endl;
-            return 1;
-         }
+         BOOST_STATIC_ASSERT_MSG (boost::has_trivial_destructor_after_move<cont>::value ==
+                                  boost::has_trivial_destructor_after_move<tree>::value
+                                 , "has_trivial_destructor_after_move(flat_multimap, std::vector) test failed");
       }
    }
 
    return 0;
 }
-
-#include <boost/container/detail/config_end.hpp>