Function ecs_emplace_id

Synopsis

#include <include/flecs.h>

FLECS_API void * ecs_emplace_id(ecs_world_t *world, ecs_entity_t entity, ecs_id_t id)

Description

Emplace a component. Emplace is similar to get_mut except that the component constructor is not invoked for the returned pointer, allowing the component to be "constructed" directly in the storage.

Emplace can only be used if the entity does not yet have the component. If the entity has the component, the operation will fail.

Parameters

world - The world.

entity - The entity.

id - The component to obtain.

Returns
The (uninitialized) component pointer.

Source

Line 1682 in include/flecs.h.