From ed7b1ab8a15e563cd2c9b8536db021eda83b0784 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Sat, 2 Nov 2024 00:00:41 +0100 Subject: [PATCH] meta: use the vtable to implement operator bool --- src/entt/meta/meta.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index 311368224..7d0459b55 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -1636,7 +1636,7 @@ public: } [[nodiscard]] explicit operator bool() const noexcept { - return static_cast(handle); + return (vtable != nullptr); } [[nodiscard]] bool operator==(const meta_iterator &other) const noexcept { @@ -1712,7 +1712,7 @@ public: } [[nodiscard]] explicit operator bool() const noexcept { - return static_cast(handle); + return (vtable != nullptr); } [[nodiscard]] bool operator==(const meta_iterator &other) const noexcept {