From 6f45f8555be7bef45b7c50a95b898ebba7fb9a92 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 14 Jul 2024 13:20:49 +0200 Subject: w --- test/bptr.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'test/bptr.cpp') diff --git a/test/bptr.cpp b/test/bptr.cpp index 3a62de53..12bd9442 100644 --- a/test/bptr.cpp +++ b/test/bptr.cpp @@ -8,7 +8,13 @@ namespace floormat { namespace { -struct Foo : bptr_base {}; +struct Foo : bptr_base +{ + int x; + + fm_DECLARE_DELETED_COPY_MOVE_ASSIGNMENTS(Foo); + Foo(int x) : x{x} {} +}; struct Bar : Foo {}; struct Baz : bptr_base {}; } // namespace @@ -334,6 +340,17 @@ void test10() fm_assert(bptr{} == bptr{}); fm_assert(bptr{} == bptr{}); fm_assert(bptr{} == bptr{}); + + auto p1 = bptr{InPlace, 1}; (void)p1; + //auto p2 = bptr{p1}; + auto p3 = bptr{p1}; (void)p3; + fm_assert(p1->x == 1); fm_assert(p3->x == 1); + fm_assert(p1 == p3); + + auto p4 = bptr{InPlace, 4}; (void)p4; + auto p5 = bptr{p4}; (void)p5; + fm_assert(p4->x == 4); fm_assert(p5->x == 4); + fm_assert(p4 == p5); } } // namespace -- cgit v1.2.3