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

EnTT 3.16.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 static auto identifier() noexcept {
19 static ENTT_MAYBE_ATOMIC(id_type) value{};
20 return value++;
21 }
22
23public:
25 using value_type = id_type;
26
28 template<typename... Type>
29 // at the time I'm writing, clang crashes during compilation if auto is used instead of family_type
30 inline static const value_type value = identifier();
31};
32
33} // namespace entt
34
35#endif
entt::family
Dynamic identifier generator.
Definition family.hpp:17
entt::family::value_type
id_type value_type
Unsigned integer type.
Definition family.hpp:25
entt::family::value
static const value_type value
Statically generated unique identifier for the given type.
Definition family.hpp:30
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