diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-11-22 17:13:03 +0100 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-12-20 15:35:58 +0100 |
commit | 58bb86fd2f0ecd740fc5bc8078de44221c12c70a (patch) | |
tree | 79e83f044d643211d3f9ebfd933e9dea92b2d04e /asl/tests | |
parent | f5ef1937eafb3d96b3683d92639a193694210c70 (diff) |
Add a niche to box
Diffstat (limited to 'asl/tests')
-rw-r--r-- | asl/tests/box_tests.cpp | 22 |
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);
}
|