Function current

Synopsis

#include <src/entt/entity/registry.hpp>

version_type current(const entity_type entity) const

Description

Returns the actual version for an identifier.

Parameters

entity - A valid identifier.

Returns
The version for the given identifier if valid, the tombstone version otherwise.

Source

Lines 549-552 in src/entt/entity/registry.hpp.

[[nodiscard]] version_type current(const entity_type entity) const {
    const auto pos = size_type(entity_traits::to_entity(entity));
    return entity_traits::to_version(pos < entities.size() ? entities[pos] : tombstone);
}





Add Discussion

Log in to comment