From 608f7b75e26976565cec66b61335b375deb1a171 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Thu, 9 Sep 2021 14:14:58 +0200 Subject: [PATCH] any: avoid creating constexpr variables since constexpr-ness isn't guaranteed --- src/entt/core/any.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()); }