any: internal changes

This commit is contained in:
skypjack
2025-10-31 18:02:53 +01:00
parent 6a25c0df84
commit 2a6f769092

View File

@@ -450,11 +450,7 @@ public:
bool assign(basic_any &&other) {
// it could be a call across boundaries, but still for the same type
if(other && (mode != any_policy::cref) && ((vtable == other.vtable) || has_value(other.info()))) {
if(auto *val = other.data(); val) {
return (vtable(request::transfer, *this, val) != nullptr);
}
return (vtable(request::assign, *this, std::as_const(other).data()) != nullptr);
return (other.mode == any_policy::cref) ? (vtable(request::assign, *this, std::as_const(other).data()) != nullptr) : (vtable(request::transfer, *this, other.data()) != nullptr);
}
return false;