xo-stringtable2: + is_gc_eligible() comptime flag

This commit is contained in:
Roland Conybeare 2026-03-24 17:37:27 -04:00
commit e70fe13c6d
2 changed files with 5 additions and 0 deletions

View file

@ -55,6 +55,8 @@ namespace xo {
/** not copyable **/
DUniqueString(const DUniqueString &) = delete;
static constexpr bool is_gc_eligible() { return false; }
///@}
/** @defgroup duniquestring-methods methods **/
///@{

View file

@ -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;