diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index acca1354c..f8de741f8 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -155,7 +155,7 @@ class meta_any { using vtable_type = void(const operation, const any &, void *); template - static void basic_vtable([[maybe_unused]] const operation op, [[maybe_unused]] const any &from, [[maybe_unused]] void *to) { + static void basic_vtable([[maybe_unused]] const operation op, [[maybe_unused]] const any &value, [[maybe_unused]] void *other) { static_assert(std::is_same_v>, Type>, "Invalid type"); if constexpr(!std::is_void_v) { @@ -163,21 +163,21 @@ class meta_any { case operation::deref: if constexpr(is_meta_pointer_like_v) { if constexpr(std::is_function_v::element_type>>) { - *static_cast(to) = any_cast(from); + *static_cast(other) = any_cast(value); } else if constexpr(!std::is_same_v::element_type>, void>) { - using in_place_type = decltype(adl_meta_pointer_like::dereference(any_cast(from))); - static_cast(to)->emplace(adl_meta_pointer_like::dereference(any_cast(from))); + using in_place_type = decltype(adl_meta_pointer_like::dereference(any_cast(value))); + static_cast(other)->emplace(adl_meta_pointer_like::dereference(any_cast(value))); } } break; case operation::seq: if constexpr(is_complete_v>) { - *static_cast(to) = {std::in_place_type, std::move(const_cast(from))}; + *static_cast(other) = {std::in_place_type, std::move(const_cast(value))}; } break; case operation::assoc: if constexpr(is_complete_v>) { - *static_cast(to) = {std::in_place_type, std::move(const_cast(from))}; + *static_cast(other) = {std::in_place_type, std::move(const_cast(value))}; } break; } @@ -509,15 +509,17 @@ public: * @return A sequence container proxy for the underlying object. */ [[nodiscard]] meta_sequence_container as_sequence_container() ENTT_NOEXCEPT { + any detached = storage.as_ref(); meta_sequence_container proxy; - vtable(operation::seq, storage.as_ref(), &proxy); + vtable(operation::seq, detached, &proxy); return proxy; } /*! @copydoc as_sequence_container */ [[nodiscard]] meta_sequence_container as_sequence_container() const ENTT_NOEXCEPT { + any detached = storage.as_ref(); meta_sequence_container proxy; - vtable(operation::seq, storage.as_ref(), &proxy); + vtable(operation::seq, detached, &proxy); return proxy; } @@ -526,15 +528,17 @@ public: * @return An associative container proxy for the underlying object. */ [[nodiscard]] meta_associative_container as_associative_container() ENTT_NOEXCEPT { + any detached = storage.as_ref(); meta_associative_container proxy; - vtable(operation::assoc, storage.as_ref(), &proxy); + vtable(operation::assoc, detached, &proxy); return proxy; } /*! @copydoc as_associative_container */ [[nodiscard]] meta_associative_container as_associative_container() const ENTT_NOEXCEPT { + any detached = storage.as_ref(); meta_associative_container proxy; - vtable(operation::assoc, storage.as_ref(), &proxy); + vtable(operation::assoc, detached, &proxy); return proxy; } @@ -1463,13 +1467,13 @@ class meta_sequence_container::meta_iterator { using vtable_type = void(const operation, const any &, void *); template - static void basic_vtable(const operation op, const any &from, void *to) { + static void basic_vtable(const operation op, const any &value, void *other) { switch(op) { case operation::incr: - ++any_cast(const_cast(from)); + ++any_cast(const_cast(value)); break; case operation::deref: - static_cast(to)->emplace::reference>(*any_cast(from)); + static_cast(other)->emplace::reference>(*any_cast(value)); break; } } @@ -1663,18 +1667,18 @@ class meta_associative_container::meta_iterator { using vtable_type = void(const operation, const any &, void *); template - static void basic_vtable(const operation op, const any &from, void *to) { + static void basic_vtable(const operation op, const any &value, void *other) { switch(op) { case operation::incr: - ++any_cast(const_cast(from)); + ++any_cast(const_cast(value)); break; case operation::deref: - const auto &it = any_cast(from); + const auto &it = any_cast(value); if constexpr(KeyOnly) { - static_cast *>(to)->first.emplace(*it); + static_cast *>(other)->first.emplace(*it); } else { - static_cast *>(to)->first.emplacefirst))>(it->first); - static_cast *>(to)->second.emplacesecond))>(it->second); + static_cast *>(other)->first.emplacefirst))>(it->first); + static_cast *>(other)->second.emplacesecond))>(it->second); } break; }