diff --git a/src/entt/core/family.hpp b/src/entt/core/family.hpp index da84acf67..3a4610102 100644 --- a/src/entt/core/family.hpp +++ b/src/entt/core/family.hpp @@ -20,10 +20,6 @@ template class family { inline static ENTT_MAYBE_ATOMIC(ENTT_ID_TYPE) identifier{}; - template - // clang (since version 9) started to complain if auto is used instead of ENTT_ID_TYPE - inline static const ENTT_ID_TYPE inner = identifier++; - public: /*! @brief Unsigned integer type. */ using family_type = ENTT_ID_TYPE; @@ -31,7 +27,7 @@ public: /*! @brief Statically generated unique identifier for the given type. */ template // at the time I'm writing, clang crashes during compilation if auto is used instead of family_type - inline static const family_type type = inner...>; + inline static const family_type type = identifier++; }; diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index d10ecfa2f..90fed4f1e 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -218,7 +218,7 @@ class basic_registry { if constexpr(is_named_type_v) { return named_type_traits_v; } else { - return Family::template type; + return Family::template type>; } } diff --git a/src/entt/signal/dispatcher.hpp b/src/entt/signal/dispatcher.hpp index ee5c66b67..4b66f5c83 100644 --- a/src/entt/signal/dispatcher.hpp +++ b/src/entt/signal/dispatcher.hpp @@ -90,7 +90,7 @@ class dispatcher { if constexpr(is_named_type_v) { return named_type_traits_v; } else { - return event_family::type; + return event_family::type>; } } diff --git a/src/entt/signal/emitter.hpp b/src/entt/signal/emitter.hpp index a2e07d05e..ed68461e1 100644 --- a/src/entt/signal/emitter.hpp +++ b/src/entt/signal/emitter.hpp @@ -125,7 +125,7 @@ class emitter { if constexpr(is_named_type_v) { return named_type_traits_v; } else { - return handler_family::type; + return handler_family::type>; } } diff --git a/test/entt/core/family.cpp b/test/entt/core/family.cpp index 147ca82ba..83106af58 100644 --- a/test/entt/core/family.cpp +++ b/test/entt/core/family.cpp @@ -16,7 +16,7 @@ TEST(Family, Functionalities) { } TEST(Family, Uniqueness) { - ASSERT_EQ(a_family::type, a_family::type); - ASSERT_EQ(a_family::type, a_family::type); - ASSERT_EQ(a_family::type, a_family::type); + ASSERT_NE(a_family::type, a_family::type); + ASSERT_NE(a_family::type, a_family::type); + ASSERT_NE(a_family::type, a_family::type); }