Function second

Synopsis

#include <include/flecs/addons/cpp/mixins/id/decl.hpp>

flecs::entity second() const

Description

Get second element from a pair. If the id is not a pair, this operation will fail. When the id has a world, the operation will ensure that the returned id has the correct generation count.

Mentioned in

Source

Lines 25-32 in include/flecs/addons/cpp/mixins/id/impl.hpp. Line 100 in include/flecs/addons/cpp/mixins/id/decl.hpp.

inline flecs::entity id::second() const {
    flecs::entity_t e = ECS_PAIR_SECOND(m_id);
    if (m_world) {
        return flecs::entity(m_world, ecs_get_alive(m_world, e));
    } else {
        return flecs::entity(m_world, e);
    }
}