Parcourir la source

any: avoid using vtable ptr with has_value

skypjack il y a 6 mois
Parent
commit
1487ad292b
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/entt/core/any.hpp

+ 1 - 1
src/entt/core/any.hpp

@@ -316,7 +316,7 @@ public:
      * @return False if the wrapper is empty, true otherwise.
      */
     [[nodiscard]] bool has_value() const noexcept {
-        return (vtable != nullptr);
+        return (mode != any_policy::empty);
     }
 
     /**