forked from boostorg/container
Merge remote-tracking branch 'origin/develop' into patch-1
This commit is contained in:
@@ -10,8 +10,10 @@
|
||||
|
||||
#include <boost/container/detail/config_begin.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/container/flat_set.hpp>
|
||||
#include <boost/container/detail/container_or_allocator_rebind.hpp>
|
||||
@@ -849,6 +851,77 @@ int main()
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////
|
||||
// has_trivial_destructor_after_move testing
|
||||
////////////////////////////////////
|
||||
{
|
||||
typedef boost::container::dtl::identity<int> key_of_value_t;
|
||||
// flat_set, default
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user