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

@@ -562,6 +562,34 @@ int main()
return 1;
}
////////////////////////////////////
// has_trivial_destructor_after_move testing
////////////////////////////////////
// default allocator
{
typedef boost::container::basic_string<char> cont;
typedef cont::allocator_type allocator_type;
typedef boost::container::allocator_traits<allocator_type>::pointer pointer;
if (boost::has_trivial_destructor_after_move<cont>::value !=
boost::has_trivial_destructor_after_move<allocator_type>::value &&
boost::has_trivial_destructor_after_move<pointer>::value) {
std::cerr << "has_trivial_destructor_after_move(default allocator) test failed" << std::endl;
return 1;
}
}
// std::allocator
{
typedef boost::container::basic_string<char, std::char_traits<char>, std::allocator<char> > cont;
typedef cont::allocator_type allocator_type;
typedef boost::container::allocator_traits<allocator_type>::pointer pointer;
if (boost::has_trivial_destructor_after_move<cont>::value !=
boost::has_trivial_destructor_after_move<allocator_type>::value &&
boost::has_trivial_destructor_after_move<pointer>::value) {
std::cerr << "has_trivial_destructor_after_move(std::allocator) test failed" << std::endl;
return 1;
}
}
return boost::report_errors();
}