Function pair

Synopsis

#include <include/flecs/addons/cpp/iter.hpp>

flecs::id pair(int32_t index) const

Description

Obtain pair id matched for field. This operation will fail if the id is not a pair.

Parameters

index - The field index.

Mentioned in

Source

Lines 40-46 in include/flecs/addons/cpp/impl/iter.hpp. Line 289 in include/flecs/addons/cpp/iter.hpp.

inline flecs::id iter::pair(int32_t index) const {
    flecs::id_t id = ecs_field_id(m_iter, index);
    ecs_check(ECS_HAS_ID_FLAG(id, PAIR), ECS_INVALID_PARAMETER, NULL);
    return flecs::id(m_iter->world, id);
error:
    return flecs::id();
}