Bladeren bron

type_id: built-in variadic accepts only single types

Michele Caini 6 jaren geleden
bovenliggende
commit
449b03f6bd
1 gewijzigde bestanden met toevoegingen van 2 en 0 verwijderingen
  1. 2 0
      src/entt/core/type_info.hpp

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

@@ -22,6 +22,7 @@ struct type_id {
      * @return The numeric representation of the given type.
      * @return The numeric representation of the given type.
      */
      */
     static constexpr ENTT_ID_TYPE value() ENTT_NOEXCEPT {
     static constexpr ENTT_ID_TYPE value() ENTT_NOEXCEPT {
+        static_assert(std::is_same_v<Type..., Type...>);
         return entt::hashed_string{__FUNCSIG__};
         return entt::hashed_string{__FUNCSIG__};
     }
     }
 #elif defined __GNUC__
 #elif defined __GNUC__
@@ -30,6 +31,7 @@ struct type_id {
      * @return The numeric representation of the given type.
      * @return The numeric representation of the given type.
      */
      */
     static constexpr ENTT_ID_TYPE value() ENTT_NOEXCEPT {
     static constexpr ENTT_ID_TYPE value() ENTT_NOEXCEPT {
+        static_assert(std::is_same_v<Type..., Type...>);
         return entt::hashed_string{__PRETTY_FUNCTION__};
         return entt::hashed_string{__PRETTY_FUNCTION__};
     }
     }
 #endif
 #endif