Browse Source

meta: use the vtable to implement operator bool

Michele Caini 1 year ago
parent
commit
ed7b1ab8a1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/entt/meta/meta.hpp

+ 2 - 2
src/entt/meta/meta.hpp

@@ -1636,7 +1636,7 @@ public:
     }
     }
 
 
     [[nodiscard]] explicit operator bool() const noexcept {
     [[nodiscard]] explicit operator bool() const noexcept {
-        return static_cast<bool>(handle);
+        return (vtable != nullptr);
     }
     }
 
 
     [[nodiscard]] bool operator==(const meta_iterator &other) const noexcept {
     [[nodiscard]] bool operator==(const meta_iterator &other) const noexcept {
@@ -1712,7 +1712,7 @@ public:
     }
     }
 
 
     [[nodiscard]] explicit operator bool() const noexcept {
     [[nodiscard]] explicit operator bool() const noexcept {
-        return static_cast<bool>(handle);
+        return (vtable != nullptr);
     }
     }
 
 
     [[nodiscard]] bool operator==(const meta_iterator &other) const noexcept {
     [[nodiscard]] bool operator==(const meta_iterator &other) const noexcept {