summaryrefslogtreecommitdiff
path: root/asl/tests
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2024-11-22 17:13:03 +0100
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2024-12-20 15:35:58 +0100
commit58bb86fd2f0ecd740fc5bc8078de44221c12c70a (patch)
tree79e83f044d643211d3f9ebfd933e9dea92b2d04e /asl/tests
parentf5ef1937eafb3d96b3683d92639a193694210c70 (diff)
Add a niche to box
Diffstat (limited to 'asl/tests')
-rw-r--r--asl/tests/box_tests.cpp22
1 files changed, 6 insertions, 16 deletions
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<int>) == sizeof(int*));
-static_assert(asl::default_constructible<asl::box<int>>);
static_assert(!asl::copyable<asl::box<int>>);
static_assert(asl::moveable<asl::box<int>>);
-static_assert(asl::default_constructible<asl::box<NonMoveConstructible>>);
+static_assert(asl::has_niche<asl::box<int>>);
ASL_TEST(destructor)
{
bool d = false;
{
- asl::box<DestructorObserver> box2;
-
- {
- auto box = asl::make_box<DestructorObserver>(&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<DestructorObserver>(&d);
+ ASL_TEST_ASSERT(!d);
+
+
+ auto box3 = ASL_MOVE(box);
ASL_TEST_ASSERT(!d);
}