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...>
17class family {
18 static auto identifier() noexcept {
19 static ENTT_MAYBE_ATOMIC(id_type) value{};
20 return value++;
21 }
22
23public:
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
Dynamic identifier generator.
Definition family.hpp:17
id_type value_type
Unsigned integer type.
Definition family.hpp:25
static const value_type value
Statically generated unique identifier for the given type.
Definition family.hpp:30
EnTT default namespace.
Definition dense_map.hpp:22
std::uint32_t id_type
Alias declaration for type identifiers.
Definition fwd.hpp:29