Fix has_trivial_destructor_after_move

Most template type parameters 'Allocator' were modified their default type to void since 1.70.0.
These modifications cause has_trivial_destructor_after_move to compile error or yield wrong result.
So, fix them by changing specializations of has_trivial_destructor_after_move.
This commit is contained in:
Mitsuru Kariya
2019-06-01 22:36:54 +09:00
parent 9e2913d4e3
commit f25c767a2b
25 changed files with 555 additions and 58 deletions
+73
View File
@@ -10,7 +10,9 @@
#include <boost/container/detail/config_begin.hpp>
#include <iostream>
#include <set>
#include <vector>
#include <boost/container/flat_set.hpp>
#include <boost/container/detail/container_or_allocator_rebind.hpp>
@@ -813,6 +815,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;
}