Przeglądaj źródła

ident: minor changes

skypjack 1 miesiąc temu
rodzic
commit
c6235fc047
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      src/entt/core/ident.hpp

+ 2 - 2
src/entt/core/ident.hpp

@@ -17,7 +17,6 @@ template<typename... Type>
 class ident {
     template<typename Curr, std::size_t... Index>
     [[nodiscard]] static ENTT_CONSTEVAL id_type get(std::index_sequence<Index...>) noexcept {
-        static_assert((std::is_same_v<Curr, Type> || ...), "Invalid type");
         return (0 + ... + (std::is_same_v<Curr, type_list_element_t<Index, type_list<std::decay_t<Type>...>>> ? id_type{Index} : id_type{}));
     }
 
@@ -27,7 +26,8 @@ public:
 
     /*! @brief Statically generated unique identifier for the given type. */
     template<typename Curr>
-    static constexpr value_type value = get<std::decay_t<Curr>>(std::index_sequence_for<Type...>{});
+    requires (std::is_same_v<std::remove_cvref_t<Curr>, Type> || ...)
+    static constexpr value_type value = get<std::remove_cvref_t<Curr>>(std::index_sequence_for<Type...>{});
 };
 
 } // namespace entt