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
+36
View File
@@ -9,6 +9,10 @@
//////////////////////////////////////////////////////////////////////////////
#include <boost/container/detail/tree.hpp>
#include <boost/container/adaptive_pool.hpp>
#include <boost/container/new_allocator.hpp>
#include <boost/move/traits.hpp>
#include <iostream>
#include "movable_int.hpp"
#include "dummy_test_allocator.hpp"
@@ -79,5 +83,37 @@ template class tree
int main ()
{
////////////////////////////////////
// has_trivial_destructor_after_move testing
////////////////////////////////////
// default
{
typedef boost::container::dtl::tree<int, void, std::less<int>, void, void> tree;
typedef tree::allocator_type allocator_type;
typedef boost::container::allocator_traits<allocator_type>::pointer pointer;
typedef tree::key_compare key_compare;
if (boost::has_trivial_destructor_after_move<tree>::value !=
boost::has_trivial_destructor_after_move<allocator_type>::value &&
boost::has_trivial_destructor_after_move<pointer>::value &&
boost::has_trivial_destructor_after_move<key_compare>::value) {
std::cerr << "has_trivial_destructor_after_move(default allocator) test failed" << std::endl;
return 1;
}
}
// std::allocator
{
typedef boost::container::dtl::tree<int, void, std::less<int>, std::allocator<int>, void> tree;
typedef tree::allocator_type allocator_type;
typedef boost::container::allocator_traits<allocator_type>::pointer pointer;
typedef tree::key_compare key_compare;
if (boost::has_trivial_destructor_after_move<tree>::value !=
boost::has_trivial_destructor_after_move<allocator_type>::value &&
boost::has_trivial_destructor_after_move<pointer>::value &&
boost::has_trivial_destructor_after_move<key_compare>::value) {
std::cerr << "has_trivial_destructor_after_move(std::allocator) test failed" << std::endl;
return 1;
}
}
return 0;
}