|
|
@@ -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
|