瀏覽代碼

any: cleanup

skypjack 8 月之前
父節點
當前提交
75ae0a10d0
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      src/entt/core/any.hpp

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

@@ -340,9 +340,8 @@ public:
     template<typename Type>
     template<typename Type>
     [[nodiscard]] bool has_value() const noexcept {
     [[nodiscard]] bool has_value() const noexcept {
         static_assert(std::is_same_v<std::remove_const_t<Type>, Type>, "Invalid type");
         static_assert(std::is_same_v<std::remove_const_t<Type>, Type>, "Invalid type");
-        static constexpr auto *other = &basic_vtable<Type>;
         // it could be a call across boundaries, but still for the same type
         // it could be a call across boundaries, but still for the same type
-        return (vtable == other) || has_value(type_id<Type>());
+        return (vtable == &basic_vtable<Type>) || has_value(type_id<Type>());
     }
     }
 
 
     /**
     /**