Function try_get

Synopsis

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

template <typename... Component>
auto try_get() const

Description

Returns pointers to the given components for a handle.

See
basic_registry::try_get
Template Parameters

Component - Types of components to get.

Return
Pointers to the components owned by the handle.

Source

Lines 259-263 in src/entt/entity/handle.hpp.

template<typename... Component>
[[nodiscard]] auto try_get() const {
    static_assert(sizeof...(Type) == 0 || (type_list_contains_v<type_list<Type...>, Component> && ...));
    return reg->template try_get<Component...>(entt);
}





Add Discussion

Log in to comment