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-05-28 19:26:19 +09:00
parent 9e2913d4e3
commit f25c767a2b
25 changed files with 555 additions and 58 deletions

View File

@@ -12,6 +12,8 @@
#include <boost/container/stable_vector.hpp>
#include <boost/container/static_vector.hpp>
#include <iostream>
#include "movable_int.hpp"
#include "dummy_test_allocator.hpp"
@@ -120,5 +122,35 @@ template class flat_tree
int main ()
{
////////////////////////////////////
// has_trivial_destructor_after_move testing
////////////////////////////////////
// default
{
typedef boost::container::dtl::flat_tree<int, boost::container::dtl::identity<int>,
std::less<int>, void> tree;
typedef tree::container_type container_type;
typedef tree::key_compare key_compare;
if (boost::has_trivial_destructor_after_move<tree>::value !=
boost::has_trivial_destructor_after_move<container_type>::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::flat_tree<int, boost::container::dtl::identity<int>,
std::less<int>, std::allocator<int> > tree;
typedef tree::container_type container_type;
typedef tree::key_compare key_compare;
if (boost::has_trivial_destructor_after_move<tree>::value !=
boost::has_trivial_destructor_after_move<container_type>::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;
}