EnTT: src/entt/core/family.hpp Source File

EnTT 3.15.0

Loading...
Searching...
No Matches
family.hpp
1#ifndef ENTT_CORE_FAMILY_HPP
2#define ENTT_CORE_FAMILY_HPP
3
4#include "../config/config.h"
5#include "fwd.hpp"
6
7namespace entt {
8
16template<typename...>
17 class family {
18 // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
19 inline static ENTT_MAYBE_ATOMIC(id_type) identifier{};
20
21public:
23 using value_type = id_type;
24
26 template<typename... Type>
27 // at the time I'm writing, clang crashes during compilation if auto is used instead of family_type
28 inline static const value_type value = identifier++;
29};
30
31} // namespace entt
32
33#endif
entt::family
Dynamic identifier generator.
Definition family.hpp:17
entt::family::value_type
id_type value_type
Unsigned integer type.
Definition family.hpp:23
entt::family::value
static const value_type value
Statically generated unique identifier for the given type.
Definition family.hpp:28
entt
EnTT default namespace.
Definition dense_map.hpp:22
entt::id_type
std::uint32_t id_type
Alias declaration for type identifiers.
Definition fwd.hpp:29