From 68f04870bf40009a4492f7630a5268a1edcd1dac Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 26 Mar 2026 14:57:15 -0400 Subject: [PATCH] xo-alloc2: abox: fix for non-anonymous abox instances --- include/xo/alloc2/abox.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/xo/alloc2/abox.hpp b/include/xo/alloc2/abox.hpp index 1e032b0..c104e3d 100644 --- a/include/xo/alloc2/abox.hpp +++ b/include/xo/alloc2/abox.hpp @@ -92,10 +92,18 @@ namespace xo { // -------------------------------- /** explicit conversion to obj **/ - obj to_op() const noexcept { + obj to_op() const noexcept + requires std::is_same_v + { return obj(this->iface(), this->data()); } + obj to_op() const noexcept + requires (!std::is_same_v) + { + return obj(this->data()); + } + /** Take ownership from unowned object **/ template abox & adopt(const obj & other)