Function raw

Synopsis

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

template <typename Component>
Component * raw() const noexcept

Description

Direct access to the list of components of a given pool.

The returned pointer is such that range [raw<Component>(), raw<Component>() + size()) is always a valid range, even if the container is empty.

Warning
This function is only available for owned types.
Template Parameters

Component - Type of component in which one is interested.

Return
A pointer to the array of components.

Source

Lines 672-676 in src/entt/entity/group.hpp.

template<typename Component>
[[nodiscard]] Component * raw() const ENTT_NOEXCEPT {
    static_assert((std::is_same_v<Component, Owned> || ...));
    return std::get<storage_type<Component> *>(pools)->raw();
}





Add Discussion

Log in to comment