From e70fe13c6dec106a1c090f8e871cb421371b5bc5 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 24 Mar 2026 17:37:27 -0400 Subject: [PATCH] xo-stringtable2: + is_gc_eligible() comptime flag --- include/xo/stringtable2/DUniqueString.hpp | 2 ++ include/xo/stringtable2/StringTable.hpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/xo/stringtable2/DUniqueString.hpp b/include/xo/stringtable2/DUniqueString.hpp index 9f56a9c..9a4357e 100644 --- a/include/xo/stringtable2/DUniqueString.hpp +++ b/include/xo/stringtable2/DUniqueString.hpp @@ -55,6 +55,8 @@ namespace xo { /** not copyable **/ DUniqueString(const DUniqueString &) = delete; + static constexpr bool is_gc_eligible() { return false; } + ///@} /** @defgroup duniquestring-methods methods **/ ///@{ diff --git a/include/xo/stringtable2/StringTable.hpp b/include/xo/stringtable2/StringTable.hpp index 2a0d570..f7e0fc1 100644 --- a/include/xo/stringtable2/StringTable.hpp +++ b/include/xo/stringtable2/StringTable.hpp @@ -31,6 +31,9 @@ namespace xo { StringTable(size_type hint_max_capacity, bool debug_flag = false); + /** false -> not eligible for GC (maps own memory + not moveable) **/ + static constexpr bool is_gc_eligible() { return false; } + /** lookup interned string; nullptr if not present **/ const DUniqueString * lookup(std::string_view key) const;