Function operator bool

Synopsis

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

explicit operator bool() const noexcept

Description

Checks if a handle refers to non-null registry pointer and entity.

Return
True if the handle refers to non-null registry and entity, false otherwise.

Source

Lines 88-90 in src/entt/entity/handle.hpp.

[[nodiscard]] explicit operator bool() const ENTT_NOEXCEPT {
    return reg && entt != null;
}





Add Discussion

Log in to comment