Преглед изворни кода

type_info: force constexpr-ness (close #396)

Michele Caini пре 6 година
родитељ
комит
797b5bcb53
1 измењених фајлова са 2 додато и 1 уклоњено
  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
     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
     static ENTT_ID_TYPE id() ENTT_NOEXCEPT {