mirror of
https://github.com/boostorg/container.git
synced 2025-07-31 21:14:30 +02:00
Use static_assert instead of runtime checks for "has_trivial_destructor_after_move"
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user