diff --git a/src/entt/core/any.hpp b/src/entt/core/any.hpp index 455ad635e..b7c37049c 100644 --- a/src/entt/core/any.hpp +++ b/src/entt/core/any.hpp @@ -393,7 +393,7 @@ Type any_cast(basic_any &&data) ENTT_NOEXCEPT { /*! @copydoc any_cast */ template const Type * any_cast(const basic_any *data) ENTT_NOEXCEPT { - if(constexpr auto hash = type_hash>>::value(); hash == data->type().hash_code()) { + if(data->type().hash_code() == type_hash>>::value()) { return static_cast(data->data()); } @@ -404,7 +404,7 @@ const Type * any_cast(const basic_any *data) ENTT_NOEXCEPT { /*! @copydoc any_cast */ template Type * any_cast(basic_any *data) ENTT_NOEXCEPT { - if(constexpr auto hash = type_hash>>::value(); hash == data->type().hash_code()) { + if(data->type().hash_code() == type_hash>>::value()) { // last attempt to make wrappers for const references return their values return static_cast(static_cast, Type> *>(data)->data()); }