Function has

Synopsis

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

template <typename T>
bool has() const

Description

Test if world has singleton component.

Source

Lines 102-106 in include/flecs/addons/cpp/impl/world.hpp. Line 559 in include/flecs/addons/cpp/world.hpp.

template <typename T>
bool world::has() const {
    flecs::entity e(m_world, _::cpp_type<T>::id(m_world));
    return e.has<T>();
}