diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2023-03-05 21:00:21 +0100 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2023-03-05 21:00:21 +0100 |
| commit | a87ad2eac867b77a75e05ad48bb3ee622e5735d3 (patch) | |
| tree | 95e75fa21b0d4000d32eeb127c9d68a83218846d /include/api-test/handle.hpp | |
| parent | 290e4c3c33f9af401c0565b840de3514d199faf5 (diff) | |
Change freelist implementation
Diffstat (limited to 'include/api-test/handle.hpp')
| -rw-r--r-- | include/api-test/handle.hpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/api-test/handle.hpp b/include/api-test/handle.hpp index a81480a..72c46a2 100644 --- a/include/api-test/handle.hpp +++ b/include/api-test/handle.hpp @@ -2,9 +2,19 @@ #include <cstdint> -template<typename T> +// template<typename T> +// struct handle { +// uint32_t id = handle::invalid_id; +// +// [[nodiscard]] inline bool is_valid() const { return id != handle::invalid_id; } +// +// static constexpr uint32_t invalid_id = -1U; +// }; + +template<typename U> struct handle { - uint32_t id = handle::invalid_id; + uint32_t id = invalid_id; + uint32_t generation = 0U; [[nodiscard]] inline bool is_valid() const { return id != handle::invalid_id; } |
