1
0
Эх сурвалжийг харах

family: rework/get rid of NOLINT

skypjack 6 сар өмнө
parent
commit
9b3965c2c9

+ 5 - 3
src/entt/core/family.hpp

@@ -15,8 +15,10 @@ namespace entt {
  */
 template<typename...>
 class family {
-    // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
-    inline static ENTT_MAYBE_ATOMIC(id_type) identifier{};
+    static auto identifier() noexcept {
+        static ENTT_MAYBE_ATOMIC(id_type) value{};
+        return value++;
+    }
 
 public:
     /*! @brief Unsigned integer type. */
@@ -25,7 +27,7 @@ public:
     /*! @brief Statically generated unique identifier for the given type. */
     template<typename... Type>
     // at the time I'm writing, clang crashes during compilation if auto is used instead of family_type
-    inline static const value_type value = identifier++;
+    inline static const value_type value = identifier();
 };
 
 } // namespace entt