skypjack vor 3 Monaten
Ursprung
Commit
16fae2d625
1 geänderte Dateien mit 3 neuen und 14 gelöschten Zeilen
  1. 3 14
      src/entt/meta/meta.hpp

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

@@ -424,8 +424,6 @@ public:
     template<typename Type>
     [[nodiscard]] Type *try_cast() {
         return ((storage.policy() == any_policy::cref) && !std::is_const_v<Type>) ? nullptr : const_cast<Type *>(std::as_const(*this).try_cast<std::remove_const_t<Type>>());
-        // NOLINTNEXTLINE(bugprone-casting-through-void)
-        return ((elem != nullptr) || !*this || storage.has_value<std::remove_const_t<Type>>()) ? elem : static_cast<Type *>(const_cast<constness_as_t<void, Type> *>(internal::try_cast(internal::meta_context::from(*ctx), fetch_node(), type_hash<std::remove_const_t<Type>>::value(), static_cast<constness_as_t<any, Type> &>(storage).data())));
     }
 
     /**
@@ -589,10 +587,7 @@ public:
         return ret;
     }
 
-    /**
-     * @brief Returns false if a wrapper is invalid, true otherwise.
-     * @return False if the wrapper is invalid, true otherwise.
-     */
+    /*! @copydoc any::operator bool */
     [[nodiscard]] explicit operator bool() const noexcept {
         return !(vtable == nullptr);
     }
@@ -1039,10 +1034,7 @@ public:
         return (node_or_assert().next != nullptr) ? meta_func{*ctx, *node_or_assert().next} : meta_func{};
     }
 
-    /**
-     * @brief Returns true if an object is valid, false otherwise.
-     * @return True if the object is valid, false otherwise.
-     */
+    /*! @copydoc meta_data::operator bool */
     [[nodiscard]] explicit operator bool() const noexcept {
         return (node != nullptr);
     }
@@ -1523,10 +1515,7 @@ public:
         return fetch_node().custom;
     }
 
-    /**
-     * @brief Returns true if an object is valid, false otherwise.
-     * @return True if the object is valid, false otherwise.
-     */
+    /*! @copydoc meta_data::operator bool */
     [[nodiscard]] explicit operator bool() const noexcept {
         return (node != nullptr);
     }