Explorar o código

type_info: force constexpr-ness (close #396)

Michele Caini %!s(int64=6) %!d(string=hai) anos
pai
achega
797b5bcb53
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/entt/core/type_info.hpp

+ 2 - 1
src/entt/core/type_info.hpp

@@ -57,7 +57,8 @@ struct ENTT_TYPE_ID_API type_info {
      */
      */
 #ifdef ENTT_PRETTY_FUNCTION
 #ifdef ENTT_PRETTY_FUNCTION
     static constexpr ENTT_ID_TYPE id() ENTT_NOEXCEPT {
     static constexpr ENTT_ID_TYPE id() ENTT_NOEXCEPT {
-        return entt::hashed_string{ENTT_PRETTY_FUNCTION};
+        constexpr auto value = entt::hashed_string::value(ENTT_PRETTY_FUNCTION);
+        return value;
     }
     }
 #else
 #else
     static ENTT_ID_TYPE id() ENTT_NOEXCEPT {
     static ENTT_ID_TYPE id() ENTT_NOEXCEPT {