diff options
Diffstat (limited to 'include/handle.hpp')
| -rw-r--r-- | include/handle.hpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/handle.hpp b/include/handle.hpp new file mode 100644 index 0000000..484b217 --- /dev/null +++ b/include/handle.hpp @@ -0,0 +1,13 @@ +#pragma once + +#include <cstdint> + +template<typename U> +struct handle { + uint32_t id = invalid_id; + uint32_t generation = 0U; + + [[nodiscard]] inline bool is_valid() const { return id != handle::invalid_id; } + + static constexpr uint32_t invalid_id = UINT32_MAX; +}; |
