Fix fca allocator swapping, and test that pmr allocator swap compiles

This commit is contained in:
Braden Ganetsky
2024-03-24 12:22:45 -05:00
parent e816ba511c
commit e63853d87d
2 changed files with 27 additions and 7 deletions
+5 -1
View File
@@ -180,6 +180,7 @@ namespace pmr_allocator_tests {
{
copy_op,
move_op,
swap_op,
};
template <class X> void do_operation(X& x1, X& x2, operation op)
@@ -191,6 +192,9 @@ namespace pmr_allocator_tests {
case move_op:
x2 = std::move(x1);
return;
case swap_op:
x1.swap(x1); // Swapping with non-equal non-pocs allocators is UB
return;
default:
BOOST_TEST(false);
}
@@ -231,7 +235,7 @@ namespace pmr_allocator_tests {
UNORDERED_TEST(
pmr_no_propagate_on_operation,
PMR_ALLOCATOR_TESTS_ARGS
((copy_op)(move_op))
((copy_op)(move_op)(swap_op))
)
// clang-format on