diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index 78e2ec331..01067d8f2 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -184,7 +184,7 @@ class meta_any { } if constexpr(is_meta_pointer_like_v) { - if(req == internal::meta_traits::is_pointer_like) { + if(!!(req & internal::meta_traits::is_pointer_like)) { if constexpr(std::is_function_v::element_type>) { static_cast(other)->emplace(any_cast(value.storage)); } else if constexpr(!std::is_void_v::element_type>>) { @@ -609,12 +609,19 @@ public: * @return A wrapper that shares a reference to an unmanaged object if the * wrapped element is dereferenceable, an invalid meta any otherwise. */ - [[nodiscard]] meta_any operator*() const noexcept { + [[nodiscard]] meta_any operator*() noexcept { meta_any ret{meta_ctx_arg, *ctx}; if(*this) { vtable(internal::meta_traits::is_pointer_like, *this, &ret); } return ret; } + /*! @copydoc operator* */ + [[nodiscard]] meta_any operator*() const noexcept { + meta_any ret{meta_ctx_arg, *ctx}; + if(*this) { vtable(internal::meta_traits::is_pointer_like | internal::meta_traits::is_const, *this, &ret); } + return ret; + } + /*! @copydoc any::operator bool */ [[nodiscard]] explicit operator bool() const noexcept { return !(vtable == nullptr);