Use static_assert instead of runtime checks for "has_trivial_destructor_after_move"

This commit is contained in:
Ion Gaztañaga
2024-11-27 21:59:28 +01:00
parent b421899221
commit 65dc4d1ac6

View File

@@ -544,18 +544,12 @@ int main()
// default allocator
{
typedef boost::container::small_vector<int, 0> cont;
if (boost::has_trivial_destructor_after_move<cont>::value) {
std::cerr << "has_trivial_destructor_after_move(default allocator) test failed" << std::endl;
return 1;
}
BOOST_CONTAINER_STATIC_ASSERT(!boost::has_trivial_destructor_after_move<cont>::value);
}
// std::allocator
{
typedef boost::container::small_vector<int, 0, std::allocator<int> > cont;
if (boost::has_trivial_destructor_after_move<cont>::value) {
std::cerr << "has_trivial_destructor_after_move(std::allocator) test failed" << std::endl;
return 1;
}
BOOST_CONTAINER_STATIC_ASSERT(!boost::has_trivial_destructor_after_move<cont>::value);
}
return 0;