Explorar o código

type_id: built-in variadic accepts only single types

Michele Caini %!s(int64=6) %!d(string=hai) anos
pai
achega
449b03f6bd
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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.
      */
     static constexpr ENTT_ID_TYPE value() ENTT_NOEXCEPT {
+        static_assert(std::is_same_v<Type..., Type...>);
         return entt::hashed_string{__FUNCSIG__};
     }
 #elif defined __GNUC__
@@ -30,6 +31,7 @@ struct type_id {
      * @return The numeric representation of the given type.
      */
     static constexpr ENTT_ID_TYPE value() ENTT_NOEXCEPT {
+        static_assert(std::is_same_v<Type..., Type...>);
         return entt::hashed_string{__PRETTY_FUNCTION__};
     }
 #endif