From 58bb86fd2f0ecd740fc5bc8078de44221c12c70a Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Fri, 22 Nov 2024 17:13:03 +0100 Subject: Add a niche to box --- asl/tests/box_tests.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'asl/tests') diff --git a/asl/tests/box_tests.cpp b/asl/tests/box_tests.cpp index f1a35f3..3813639 100644 --- a/asl/tests/box_tests.cpp +++ b/asl/tests/box_tests.cpp @@ -4,30 +4,20 @@ #include "asl/tests/test_types.hpp" static_assert(sizeof(asl::box) == sizeof(int*)); -static_assert(asl::default_constructible>); static_assert(!asl::copyable>); static_assert(asl::moveable>); -static_assert(asl::default_constructible>); +static_assert(asl::has_niche>); ASL_TEST(destructor) { bool d = false; { - asl::box box2; - - { - auto box = asl::make_box(&d); - ASL_TEST_ASSERT(!d); - - - auto box3 = ASL_MOVE(box); - ASL_TEST_ASSERT(!d); - - box2 = ASL_MOVE(box3); - ASL_TEST_ASSERT(!d); - } - + auto box = asl::make_box(&d); + ASL_TEST_ASSERT(!d); + + + auto box3 = ASL_MOVE(box); ASL_TEST_ASSERT(!d); } -- cgit