3#include "core/memory/types.h"
15template <
typename ResourceType>
17 using resource_t = ResourceType;
21 constexpr explicit operator bool() const noexcept {
return bool(key); }
23 constexpr bool operator==(
const Handle& other)
const noexcept {
return key == other.key; }
25 constexpr bool operator!=(
const Handle& other)
const noexcept {
return key != other.key; }
30 constexpr uint32_t
id() const noexcept {
return key.index; }
Opaque, type-safe handle for resources, distinguished by ResourceType.
Definition resource_handle.h:16
constexpr uint32_t id() const noexcept
Get the sparse slot index for use as map key, sorting, or logging.
Definition resource_handle.h:30
Opaque handle pairing a sparse-array index with a generation counter.
Definition types.h:14