diff --git a/example/doc_custom_tree.cpp b/example/doc_custom_tree.cpp index ce10748..170d3b7 100644 --- a/example/doc_custom_tree.cpp +++ b/example/doc_custom_tree.cpp @@ -7,8 +7,6 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include -#include //[doc_custom_tree #include @@ -66,4 +64,3 @@ int main () return 0; } //] -#include diff --git a/example/doc_emplace.cpp b/example/doc_emplace.cpp index 10ab743..fc7bc3b 100644 --- a/example/doc_emplace.cpp +++ b/example/doc_emplace.cpp @@ -7,8 +7,7 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include -#include + //[doc_emplace #include #include @@ -41,4 +40,3 @@ int main () return 0; } //] -#include diff --git a/example/doc_extended_allocators.cpp b/example/doc_extended_allocators.cpp index 0eceba4..275086d 100644 --- a/example/doc_extended_allocators.cpp +++ b/example/doc_extended_allocators.cpp @@ -7,8 +7,7 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include -#include + //[doc_extended_allocators #include #include @@ -51,4 +50,3 @@ int main () return 0; } //] -#include diff --git a/example/doc_move_containers.cpp b/example/doc_move_containers.cpp index e7b09f0..34f7508 100644 --- a/example/doc_move_containers.cpp +++ b/example/doc_move_containers.cpp @@ -7,8 +7,7 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include -#include + //[doc_move_containers #include #include @@ -51,4 +50,3 @@ int main () return 0; } //] -#include diff --git a/example/doc_recursive_containers.cpp b/example/doc_recursive_containers.cpp index 6a1746a..7467d88 100644 --- a/example/doc_recursive_containers.cpp +++ b/example/doc_recursive_containers.cpp @@ -7,8 +7,7 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include -#include + //[doc_recursive_containers #include #include @@ -70,4 +69,3 @@ int main() return 0; } //] -#include diff --git a/example/doc_type_erasure.cpp b/example/doc_type_erasure.cpp index e776062..68f59fd 100644 --- a/example/doc_type_erasure.cpp +++ b/example/doc_type_erasure.cpp @@ -7,8 +7,7 @@ // See http://www.boost.org/libs/container for documentation. // ////////////////////////////////////////////////////////////////////////////// -#include -#include + //[doc_type_erasure_MyClassHolder_h #include @@ -87,5 +86,3 @@ const MyClass & MyClassHolder::GetLastObject() const { return vector_.back(); } //] - -#include diff --git a/test/flat_map_test.cpp b/test/flat_map_test.cpp index e2042c2..bb0f913 100644 --- a/test/flat_map_test.cpp +++ b/test/flat_map_test.cpp @@ -9,6 +9,7 @@ ////////////////////////////////////////////////////////////////////////////// #include +#include #include #include #include @@ -767,66 +768,54 @@ int main() typedef boost::container::new_allocator alloc_or_cont_t; typedef boost::container::flat_map cont; typedef boost::container::dtl::flat_tree, alloc_or_cont_t> tree; - if (boost::has_trivial_destructor_after_move::value != - boost::has_trivial_destructor_after_move::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::value == + boost::has_trivial_destructor_after_move::value + , "has_trivial_destructor_after_move(flat_map, default) test failed"); } // flat_map, vector { typedef boost::container::vector alloc_or_cont_t; typedef boost::container::flat_map, alloc_or_cont_t> cont; typedef boost::container::dtl::flat_tree, alloc_or_cont_t> tree; - if (boost::has_trivial_destructor_after_move::value != - boost::has_trivial_destructor_after_move::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::value == + boost::has_trivial_destructor_after_move::value + , "has_trivial_destructor_after_move(flat_map, vector) test failed"); } // flat_map, std::vector { typedef std::vector alloc_or_cont_t; typedef boost::container::flat_map, alloc_or_cont_t> cont; typedef boost::container::dtl::flat_tree, alloc_or_cont_t> tree; - if (boost::has_trivial_destructor_after_move::value != - boost::has_trivial_destructor_after_move::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::value == + boost::has_trivial_destructor_after_move::value + , "has_trivial_destructor_after_move(flat_map, std::vector) test failed"); } // flat_multimap, default { typedef boost::container::new_allocator alloc_or_cont_t; typedef boost::container::flat_multimap cont; typedef boost::container::dtl::flat_tree, alloc_or_cont_t> tree; - if (boost::has_trivial_destructor_after_move::value != - boost::has_trivial_destructor_after_move::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::value == + boost::has_trivial_destructor_after_move::value + , "has_trivial_destructor_after_move(flat_multimap, default) test failed"); } // flat_multimap, vector { typedef boost::container::vector alloc_or_cont_t; typedef boost::container::flat_multimap, alloc_or_cont_t> cont; typedef boost::container::dtl::flat_tree, alloc_or_cont_t> tree; - if (boost::has_trivial_destructor_after_move::value != - boost::has_trivial_destructor_after_move::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::value == + boost::has_trivial_destructor_after_move::value + , "has_trivial_destructor_after_move(flat_multimap, vector) test failed"); } // flat_multimap, std::vector { typedef std::vector alloc_or_cont_t; typedef boost::container::flat_multimap, alloc_or_cont_t> cont; typedef boost::container::dtl::flat_tree, alloc_or_cont_t> tree; - if (boost::has_trivial_destructor_after_move::value != - boost::has_trivial_destructor_after_move::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::value == + boost::has_trivial_destructor_after_move::value + , "has_trivial_destructor_after_move(flat_multimap, std::vector) test failed"); } } diff --git a/test/flat_set_test.cpp b/test/flat_set_test.cpp index 7927b99..1326d17 100644 --- a/test/flat_set_test.cpp +++ b/test/flat_set_test.cpp @@ -8,8 +8,6 @@ // ////////////////////////////////////////////////////////////////////////////// -#include - #include #include #include @@ -864,70 +862,55 @@ int main() { typedef boost::container::flat_set cont; typedef boost::container::dtl::flat_tree, void> tree; - if (boost::has_trivial_destructor_after_move::value != - boost::has_trivial_destructor_after_move::value) { - std::cerr << "has_trivial_destructor_after_move(flat_set, default) test failed" << std::endl; - return 1; - } + BOOST_STATIC_ASSERT_MSG ( boost::has_trivial_destructor_after_move::value == + boost::has_trivial_destructor_after_move::value + , "has_trivial_destructor_after_move(flat_set, default) test failed"); } // flat_set, vector { typedef boost::container::vector alloc_or_cont_t; typedef boost::container::flat_set, alloc_or_cont_t> cont; typedef boost::container::dtl::flat_tree, alloc_or_cont_t> tree; - if (boost::has_trivial_destructor_after_move::value != - boost::has_trivial_destructor_after_move::value) { - std::cerr << "has_trivial_destructor_after_move(flat_set, vector) test failed" << std::endl; - return 1; - } + BOOST_STATIC_ASSERT_MSG ( boost::has_trivial_destructor_after_move::value == + boost::has_trivial_destructor_after_move::value + , "has_trivial_destructor_after_move(flat_set, vector) test failed"); } // flat_set, std::vector { typedef std::vector alloc_or_cont_t; typedef boost::container::flat_set, alloc_or_cont_t> cont; typedef boost::container::dtl::flat_tree, alloc_or_cont_t> tree; - if (boost::has_trivial_destructor_after_move::value != - boost::has_trivial_destructor_after_move::value) { - std::cerr << "has_trivial_destructor_after_move(flat_set, std::vector) test failed" << std::endl; - return 1; - } + BOOST_STATIC_ASSERT_MSG ( boost::has_trivial_destructor_after_move::value == + boost::has_trivial_destructor_after_move::value + , "has_trivial_destructor_after_move(flat_set, std::vector) test failed"); } // flat_multiset, default { typedef boost::container::flat_multiset cont; typedef boost::container::dtl::flat_tree, void> tree; - if (boost::has_trivial_destructor_after_move::value != - boost::has_trivial_destructor_after_move::value) { - std::cerr << "has_trivial_destructor_after_move(flat_multiset, default) test failed" << std::endl; - return 1; - } + BOOST_STATIC_ASSERT_MSG ( boost::has_trivial_destructor_after_move::value == + boost::has_trivial_destructor_after_move::value + , "has_trivial_destructor_after_move(flat_multiset, default) test failed"); } // flat_multiset, vector { typedef boost::container::vector alloc_or_cont_t; typedef boost::container::flat_multiset, alloc_or_cont_t> cont; typedef boost::container::dtl::flat_tree, alloc_or_cont_t> tree; - if (boost::has_trivial_destructor_after_move::value != - boost::has_trivial_destructor_after_move::value) { - std::cerr << "has_trivial_destructor_after_move(flat_multiset, vector) test failed" << std::endl; - return 1; - } + BOOST_STATIC_ASSERT_MSG ( boost::has_trivial_destructor_after_move::value == + boost::has_trivial_destructor_after_move::value + , "has_trivial_destructor_after_move(flat_multiset, vector) test failed"); } // flat_multiset, std::vector { typedef std::vector alloc_or_cont_t; typedef boost::container::flat_multiset, alloc_or_cont_t> cont; typedef boost::container::dtl::flat_tree, alloc_or_cont_t> tree; - if (boost::has_trivial_destructor_after_move::value != - boost::has_trivial_destructor_after_move::value) { - std::cerr << "has_trivial_destructor_after_move(flat_multiset, std::vector) test failed" << std::endl; - return 1; - } + BOOST_STATIC_ASSERT_MSG ( boost::has_trivial_destructor_after_move::value == + boost::has_trivial_destructor_after_move::value + , "has_trivial_destructor_after_move(flat_multiset, std::vector) test failed"); } } return 0; } - -#include -