xo-alloc2: abox: fix for non-anonymous abox instances

This commit is contained in:
Roland Conybeare 2026-03-26 14:57:15 -04:00
commit 68f04870bf

View file

@ -92,10 +92,18 @@ namespace xo {
// --------------------------------
/** explicit conversion to obj<AFacet,DRepr> **/
obj<AFacet, DRepr> to_op() const noexcept {
obj<AFacet, DRepr> to_op() const noexcept
requires std::is_same_v<DRepr, xo::facet::DVariantPlaceholder>
{
return obj<AFacet, DRepr>(this->iface(), this->data());
}
obj<AFacet, DRepr> to_op() const noexcept
requires (!std::is_same_v<DRepr, xo::facet::DVariantPlaceholder>)
{
return obj<AFacet, DRepr>(this->data());
}
/** Take ownership from unowned object **/
template <typename DOther>
abox & adopt(const obj<AFacet, DOther> & other)