// 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>
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>