Skip to content

Commit

Permalink
Use static_assert instead of runtime checks for "has_trivial_destruct…
Browse files Browse the repository at this point in the history
…or_after_move"
  • Loading branch information
igaztanaga committed Nov 27, 2024
1 parent b421899 commit 65dc4d1
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions test/small_vector_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 65dc4d1

Please sign in to comment.