From 3c3709ba15a98e34a81d3d797436465bbb0a798b Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 3 Dec 2025 15:36:59 -0500 Subject: [PATCH] xo-alloc / xo-ordinaltree: + concepts + allocator-aware --- include/xo/alloc/Object.hpp | 5 ++++- utest/GC.test.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/xo/alloc/Object.hpp b/include/xo/alloc/Object.hpp index 9681afab..d2e742a0 100644 --- a/include/xo/alloc/Object.hpp +++ b/include/xo/alloc/Object.hpp @@ -38,7 +38,7 @@ namespace xo { return dynamic_cast(x.ptr()); } - virtual ~Object() = default; + virtual ~Object() noexcept = default; /** memory allocator for objects. Likely this will be a GC instance, * but simple arena also supported. @@ -129,6 +129,9 @@ namespace xo { virtual std::size_t _forward_children(gc::IAlloc * gc) override = 0; }; + static_assert(std::is_destructible_v, "Object must be destructible"); + static_assert(std::is_nothrow_destructible_v, "Object must be noexcept destructible"); + template void Object::assign_member(gp parent, gp * lhs, gp rhs) diff --git a/utest/GC.test.cpp b/utest/GC.test.cpp index 03b5c50a..90e22dfa 100644 --- a/utest/GC.test.cpp +++ b/utest/GC.test.cpp @@ -200,7 +200,7 @@ namespace xo { //: member2_{mem2, vector_allocator_type(alloc)}, ctor_ran_{true} {} vector_type member2_; - std::size_t ctor_ran_ = false; + bool ctor_ran_ = false; }; }