Function current

Synopsis

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

version_type current(const entity_type entity) const

Description

Returns the actual version for an entity identifier.

Warning
Attempting to use an entity that doesn't belong to the registry results in undefined behavior. An entity belongs to the registry even if it has been previously destroyed and/or recycled.
Parameters

entity - A valid entity identifier.

Returns
Actual version for the given entity identifier.

Mentioned in

Source

Lines 427-431 in src/entt/entity/registry.hpp.

[[nodiscard]] version_type current(const entity_type entity) const {
    const auto pos = size_type(to_integral(entity) & traits_type::entity_mask);
    ENTT_ASSERT(pos < entities.size());
    return version(entities[pos]);
}





Add Discussion

Log in to comment