diff --git a/include/xo/alloc2/abox.hpp b/include/xo/alloc2/abox.hpp index 1e032b06..c104e3dc 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)