瀏覽代碼

meta: use the context to implement operator bool

Michele Caini 1 年之前
父節點
當前提交
331b82ed8e
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/entt/meta/meta.hpp

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

@@ -900,7 +900,7 @@ struct meta_data {
      * @return True if the object is valid, false otherwise.
      * @return True if the object is valid, false otherwise.
      */
      */
     [[nodiscard]] explicit operator bool() const noexcept {
     [[nodiscard]] explicit operator bool() const noexcept {
-        return (node != nullptr);
+        return (ctx != nullptr);
     }
     }
 
 
     /**
     /**
@@ -1030,7 +1030,7 @@ struct meta_func {
      * @return True if the object is valid, false otherwise.
      * @return True if the object is valid, false otherwise.
      */
      */
     [[nodiscard]] explicit operator bool() const noexcept {
     [[nodiscard]] explicit operator bool() const noexcept {
-        return (node != nullptr);
+        return (ctx != nullptr);
     }
     }
 
 
     /*! @copydoc meta_data::operator== */
     /*! @copydoc meta_data::operator== */
@@ -1478,7 +1478,7 @@ public:
      * @return True if the object is valid, false otherwise.
      * @return True if the object is valid, false otherwise.
      */
      */
     [[nodiscard]] explicit operator bool() const noexcept {
     [[nodiscard]] explicit operator bool() const noexcept {
-        return !(ctx == nullptr);
+        return (ctx != nullptr);
     }
     }
 
 
     /*! @copydoc meta_data::operator== */
     /*! @copydoc meta_data::operator== */