From e15894872d5d9c5f9435a7a1fa074b7a60cd403e Mon Sep 17 00:00:00 2001 From: skypjack Date: Sat, 22 Jul 2023 11:41:14 +0200 Subject: [PATCH] meta: slightly improved meta_any::allow_cast --- src/entt/meta/meta.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index 3f7ee78a9..443d2c330 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -1620,7 +1620,7 @@ bool meta_any::set(const id_type id, Type &&value) { if(const auto *value = data(); node.details) { if(auto it = node.details->conv.find(type.info().hash()); it != node.details->conv.cend()) { - return it->second.conv(*ctx, data()); + return it->second.conv(*ctx, value); } for(auto &&curr: node.details->base) { @@ -1636,8 +1636,8 @@ bool meta_any::set(const id_type id, Type &&value) { // exploits the fact that arithmetic types and enums are also default constructible auto other = type.construct(); ENTT_ASSERT(other.node.conversion_helper, "Conversion helper not found"); - const auto value = node.conversion_helper(nullptr, storage.data()); - other.node.conversion_helper(other.storage.data(), &value); + const auto value = node.conversion_helper(nullptr, data()); + other.node.conversion_helper(other.data(), &value); return other; }