Avoid including <boost/container/detail/config_begin.hpp> in tests to catch all possible warnings.

This commit is contained in:
Ion Gaztañaga
2020-10-25 17:25:39 +01:00
parent 63073ab556
commit 3cd08df6fc
8 changed files with 42 additions and 84 deletions

View File

@ -7,8 +7,6 @@
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
//[doc_custom_tree
#include <boost/container/set.hpp>
@ -66,4 +64,3 @@ int main ()
return 0;
}
//]
#include <boost/container/detail/config_end.hpp>

View File

@ -7,8 +7,7 @@
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
//[doc_emplace
#include <boost/container/list.hpp>
#include <cassert>
@ -41,4 +40,3 @@ int main ()
return 0;
}
//]
#include <boost/container/detail/config_end.hpp>

View File

@ -7,8 +7,7 @@
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
//[doc_extended_allocators
#include <boost/container/vector.hpp>
#include <boost/container/flat_set.hpp>
@ -51,4 +50,3 @@ int main ()
return 0;
}
//]
#include <boost/container/detail/config_end.hpp>

View File

@ -7,8 +7,7 @@
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
//[doc_move_containers
#include <boost/container/vector.hpp>
#include <boost/move/utility_core.hpp>
@ -51,4 +50,3 @@ int main ()
return 0;
}
//]
#include <boost/container/detail/config_end.hpp>

View File

@ -7,8 +7,7 @@
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
//[doc_recursive_containers
#include <boost/container/vector.hpp>
#include <boost/container/stable_vector.hpp>
@ -70,4 +69,3 @@ int main()
return 0;
}
//]
#include <boost/container/detail/config_end.hpp>

View File

@ -7,8 +7,7 @@
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
//[doc_type_erasure_MyClassHolder_h
#include <boost/container/vector.hpp>
@ -87,5 +86,3 @@ const MyClass & MyClassHolder::GetLastObject() const
{ return vector_.back(); }
//]
#include <boost/container/detail/config_end.hpp>

View File

@ -9,6 +9,7 @@
//////////////////////////////////////////////////////////////////////////////
#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>
@ -767,66 +768,54 @@ 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");
}
}

View File

@ -8,8 +8,6 @@
//
//////////////////////////////////////////////////////////////////////////////
#include <boost/container/detail/config_begin.hpp>
#include <iostream>
#include <set>
#include <utility>
@ -864,70 +862,55 @@ int main()
{
typedef boost::container::flat_set<int> cont;
typedef boost::container::dtl::flat_tree<int, key_of_value_t, std::less<int>, void> 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_set, 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_set, default) test failed");
}
// flat_set, vector
{
typedef boost::container::vector<int> alloc_or_cont_t;
typedef boost::container::flat_set<int, std::less<int>, alloc_or_cont_t> cont;
typedef boost::container::dtl::flat_tree<int, 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_set, 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_set, vector) test failed");
}
// flat_set, std::vector
{
typedef std::vector<int> alloc_or_cont_t;
typedef boost::container::flat_set<int, std::less<int>, alloc_or_cont_t> cont;
typedef boost::container::dtl::flat_tree<int, 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_set, 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_set, std::vector) test failed");
}
// flat_multiset, default
{
typedef boost::container::flat_multiset<int> cont;
typedef boost::container::dtl::flat_tree<int, key_of_value_t, std::less<int>, void> 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_multiset, 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_multiset, default) test failed");
}
// flat_multiset, vector
{
typedef boost::container::vector<int> alloc_or_cont_t;
typedef boost::container::flat_multiset<int, std::less<int>, alloc_or_cont_t> cont;
typedef boost::container::dtl::flat_tree<int, 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_multiset, 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_multiset, vector) test failed");
}
// flat_multiset, std::vector
{
typedef std::vector<int> alloc_or_cont_t;
typedef boost::container::flat_multiset<int, std::less<int>, alloc_or_cont_t> cont;
typedef boost::container::dtl::flat_tree<int, 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_multiset, 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_multiset, std::vector) test failed");
}
}
return 0;
}
#include <boost/container/detail/config_end.hpp>