vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::StorageIndex Struct Reference

Opaque handle pairing a sparse-array index with a generation counter. More...

#include <types.h>

Public Member Functions

constexpr bool operator== (const StorageIndex &other) const noexcept
 Compare two handles for identity.

Public Attributes

uint32_t index = 0
 Sparse slot index; 0 is null.
uint32_t generation = 0
 The slot's generation when minted.

Detailed Description

Opaque handle pairing a sparse-array index with a generation counter.

Valid only while its generation matches the slot's, so a stale handle is detected. Index 0 is null.

Member Function Documentation

◆ operator==()

bool Vkm::Engine::StorageIndex::operator== ( const StorageIndex & other) const
inlineconstexprnoexcept

Compare two handles for identity.

Parameters
otherHandle to compare against.
Returns
True if index and generation are both equal, so a stale handle never equals its recycled slot.

The documentation for this struct was generated from the following file: