mirror of
https://github.com/boostorg/container.git
synced 2026-01-29 09:50:22 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user