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

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== */