Skip to content

Engine → Core → slot_map.h

slot_key

Syntax

struct slot_key

Variables

AccessNameTypeDefaultDescription
publicgenerationu320
publicindexu320

Functions

Public

from_u64

[[nodiscard]] static constexpr slot_key from_u64(
    u64 packed) noexcept;

Inverse of to_u64().

is_valid

[[nodiscard]] constexpr bool is_valid() const noexcept;

True for every key a slot_map has issued; false for the null key.

null

[[nodiscard]] static constexpr slot_key null() noexcept;

The all-zero key. Means "none".

to_u64

[[nodiscard]] constexpr u64 to_u64() const noexcept;

Packs the key into one integer (generation in the high 32 bits). Used for ImTextureID style opaque handles and serialisation.

Operator Overloads

Public

operator<=>

[[nodiscard]] constexpr auto operator<=>(
    const slot_key &) const noexcept = default;

operator==

[[nodiscard]] constexpr bool operator==(
    const slot_key &) const noexcept = default;