Преглед изворни кода

meta: use the vtable to implement operator bool

Michele Caini пре 1 година
родитељ
комит
ed7b1ab8a1
1 измењених фајлова са 2 додато и 2 уклоњено
  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 {
-        return static_cast<bool>(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<bool>(handle);
+        return (vtable != nullptr);
     }
 
     [[nodiscard]] bool operator==(const meta_iterator &other) const noexcept {