Explorar o código

any: deprecate type() in favor of info() for consistency

Michele Caini hai 11 meses
pai
achega
6e7ca646ec
Modificáronse 5 ficheiros con 102 adicións e 97 borrados
  1. 1 1
      TODO
  2. 19 14
      src/entt/core/any.hpp
  3. 2 2
      src/entt/entity/registry.hpp
  4. 1 1
      src/entt/poly/poly.hpp
  5. 79 79
      test/entt/core/any.cpp

+ 1 - 1
TODO

@@ -36,4 +36,4 @@ TODO:
 * improve non-const allow cast with in-place switch
 * meta fixed_size could return the size directly if present
 * setup testbed workflow on the CI and review build process for testbed (i.e. tests first due to SDL)
-* type() -> info() for consistency (any, poly, sparse_set)
+* type() -> info() for consistency (poly, sparse_set)

+ 19 - 14
src/entt/core/any.hpp

@@ -117,8 +117,8 @@ class basic_any {
         if constexpr(!std::is_void_v<Type>) {
             using plain_type = std::remove_cv_t<std::remove_reference_t<Type>>;
 
-            info = &type_id<plain_type>();
             vtable = basic_vtable<plain_type>;
+            descriptor = &type_id<plain_type>();
 
             if constexpr(std::is_lvalue_reference_v<Type>) {
                 static_assert((std::is_lvalue_reference_v<Args> && ...) && (sizeof...(Args) == 1u), "Invalid arguments");
@@ -151,8 +151,8 @@ class basic_any {
 
     basic_any(const basic_any &other, const any_policy pol) noexcept
         : instance{other.data()},
-          info{other.info},
           vtable{other.vtable},
+          descriptor{other.descriptor},
           mode{pol} {}
 
 public:
@@ -219,8 +219,8 @@ public:
      */
     basic_any(basic_any &&other) noexcept
         : instance{},
-          info{other.info},
           vtable{other.vtable},
+          descriptor{other.descriptor},
           mode{other.mode} {
         if(other.mode == any_policy::embedded) {
             other.vtable(request::move, other, this);
@@ -271,8 +271,8 @@ public:
             instance = std::exchange(other.instance, nullptr);
         }
 
-        info = other.info;
         vtable = other.vtable;
+        descriptor = other.descriptor;
         mode = other.mode;
 
         return *this;
@@ -291,11 +291,16 @@ public:
     }
 
     /**
-     * @brief Returns the object type if any, `type_id<void>()` otherwise.
-     * @return The object type if any, `type_id<void>()` otherwise.
+     * @brief Returns the object type info if any, `type_id<void>()` otherwise.
+     * @return The object type info if any, `type_id<void>()` otherwise.
      */
-    [[nodiscard]] const type_info &type() const noexcept {
-        return (info == nullptr) ? type_id<void>() : *info;
+    [[nodiscard]] const type_info &info() const noexcept {
+        return (descriptor == nullptr) ? type_id<void>() : *descriptor;
+    }
+
+    /*! @copydoc info */
+    [[deprecated("use ::info instead")]] [[nodiscard]] const type_info &type() const noexcept {
+        return info();
     }
 
     /**
@@ -312,7 +317,7 @@ public:
      * @return An opaque pointer the contained instance, if any.
      */
     [[nodiscard]] const void *data(const type_info &req) const noexcept {
-        return (type() == req) ? data() : nullptr;
+        return (info() == req) ? data() : nullptr;
     }
 
     /**
@@ -350,7 +355,7 @@ public:
      * @return True in case of success, false otherwise.
      */
     bool assign(const basic_any &other) {
-        if(vtable && mode != any_policy::cref && *info == other.type()) {
+        if(vtable && mode != any_policy::cref && *descriptor == other.info()) {
             return (vtable(request::assign, *this, other.data()) != nullptr);
         }
 
@@ -360,7 +365,7 @@ public:
     /*! @copydoc assign */
     // NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved)
     bool assign(basic_any &&other) {
-        if(vtable && mode != any_policy::cref && *info == other.type()) {
+        if(vtable && mode != any_policy::cref && *descriptor == other.info()) {
             if(auto *val = other.data(); val) {
                 return (vtable(request::transfer, *this, val) != nullptr);
             }
@@ -378,8 +383,8 @@ public:
         }
 
         instance = nullptr;
-        info = nullptr;
         vtable = nullptr;
+        descriptor = nullptr;
         mode = any_policy::empty;
     }
 
@@ -397,7 +402,7 @@ public:
      * @return False if the two objects differ in their content, true otherwise.
      */
     [[nodiscard]] bool operator==(const basic_any &other) const noexcept {
-        if(vtable && *info == other.type()) {
+        if(vtable && *descriptor == other.info()) {
             return (vtable(request::compare, *this, other.data()) != nullptr);
         }
 
@@ -447,8 +452,8 @@ private:
         const void *instance;
         storage_type storage;
     };
-    const type_info *info{};
     vtable_type *vtable{};
+    const type_info *descriptor{};
     any_policy mode{any_policy::empty};
 };
 

+ 2 - 2
src/entt/entity/registry.hpp

@@ -187,7 +187,7 @@ public:
     template<typename Type>
     bool erase(const id_type id = type_id<Type>().hash()) {
         const auto it = ctx.find(id);
-        return it != ctx.end() && it->second.type() == type_id<Type>() ? (ctx.erase(it), true) : false;
+        return it != ctx.end() && it->second.info() == type_id<Type>() ? (ctx.erase(it), true) : false;
     }
 
     template<typename Type>
@@ -215,7 +215,7 @@ public:
     template<typename Type>
     [[nodiscard]] bool contains(const id_type id = type_id<Type>().hash()) const {
         const auto it = ctx.find(id);
-        return it != ctx.cend() && it->second.type() == type_id<Type>();
+        return it != ctx.cend() && it->second.info() == type_id<Type>();
     }
 
 private:

+ 1 - 1
src/entt/poly/poly.hpp

@@ -227,7 +227,7 @@ public:
      * @return The object type if any, `type_id<void>()` otherwise.
      */
     [[nodiscard]] const type_info &type() const noexcept {
-        return storage.type();
+        return storage.info();
     }
 
     /**

+ 79 - 79
test/entt/core/any.cpp

@@ -88,7 +88,7 @@ TEST(Any, SBOInPlaceConstruction) {
     ASSERT_TRUE(any);
     ASSERT_TRUE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::dynamic);
-    ASSERT_EQ(any.type(), entt::type_id<int>());
+    ASSERT_EQ(any.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<int>(any), 2);
 
@@ -97,7 +97,7 @@ TEST(Any, SBOInPlaceConstruction) {
     ASSERT_TRUE(other);
     ASSERT_FALSE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::ref);
-    ASSERT_EQ(other.type(), entt::type_id<int>());
+    ASSERT_EQ(other.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<int>(other), 2);
     ASSERT_EQ(other.data(), any.data());
 }
@@ -109,7 +109,7 @@ TEST(Any, SBOInPlaceNullptrConstruction) {
     ASSERT_FALSE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::empty);
-    ASSERT_EQ(any.type(), entt::type_id<void>());
+    ASSERT_EQ(any.info(), entt::type_id<void>());
 }
 
 TEST(Any, SBOInPlaceTypeConstruction) {
@@ -118,7 +118,7 @@ TEST(Any, SBOInPlaceTypeConstruction) {
     ASSERT_TRUE(any);
     ASSERT_TRUE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::embedded);
-    ASSERT_EQ(any.type(), entt::type_id<int>());
+    ASSERT_EQ(any.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<int>(any), 2);
 
@@ -127,7 +127,7 @@ TEST(Any, SBOInPlaceTypeConstruction) {
     ASSERT_TRUE(other);
     ASSERT_FALSE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::ref);
-    ASSERT_EQ(other.type(), entt::type_id<int>());
+    ASSERT_EQ(other.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<int>(other), 2);
     ASSERT_EQ(other.data(), any.data());
 }
@@ -139,7 +139,7 @@ TEST(Any, SBOAsRefConstruction) {
     ASSERT_TRUE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::ref);
-    ASSERT_EQ(any.type(), entt::type_id<int>());
+    ASSERT_EQ(any.info(), entt::type_id<int>());
 
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<const int>(&any), &value);
@@ -158,7 +158,7 @@ TEST(Any, SBOAsRefConstruction) {
     ASSERT_TRUE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::ref);
-    ASSERT_EQ(any.type(), entt::type_id<int>());
+    ASSERT_EQ(any.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<int>(&any), &value);
 
     auto other = any.as_ref();
@@ -166,7 +166,7 @@ TEST(Any, SBOAsRefConstruction) {
     ASSERT_TRUE(other);
     ASSERT_FALSE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::ref);
-    ASSERT_EQ(other.type(), entt::type_id<int>());
+    ASSERT_EQ(other.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<int>(other), 2);
     ASSERT_EQ(other.data(), any.data());
 }
@@ -178,7 +178,7 @@ TEST(Any, SBOAsConstRefConstruction) {
     ASSERT_TRUE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::cref);
-    ASSERT_EQ(any.type(), entt::type_id<int>());
+    ASSERT_EQ(any.info(), entt::type_id<int>());
 
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<const int>(&any), &value);
@@ -197,7 +197,7 @@ TEST(Any, SBOAsConstRefConstruction) {
     ASSERT_TRUE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::cref);
-    ASSERT_EQ(any.type(), entt::type_id<int>());
+    ASSERT_EQ(any.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<const int>(&any), &value);
 
     auto other = any.as_ref();
@@ -205,7 +205,7 @@ TEST(Any, SBOAsConstRefConstruction) {
     ASSERT_TRUE(other);
     ASSERT_FALSE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::cref);
-    ASSERT_EQ(other.type(), entt::type_id<int>());
+    ASSERT_EQ(other.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<int>(other), 2);
     ASSERT_EQ(other.data(), any.data());
 }
@@ -218,7 +218,7 @@ TEST(Any, SBOCopyConstruction) {
     ASSERT_TRUE(other);
     ASSERT_TRUE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::embedded);
-    ASSERT_EQ(other.type(), entt::type_id<int>());
+    ASSERT_EQ(other.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<double>(&other), nullptr);
     ASSERT_EQ(entt::any_cast<int>(other), 2);
 }
@@ -233,7 +233,7 @@ TEST(Any, SBOCopyAssignment) {
     ASSERT_TRUE(other);
     ASSERT_TRUE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::embedded);
-    ASSERT_EQ(other.type(), entt::type_id<int>());
+    ASSERT_EQ(other.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<double>(&other), nullptr);
     ASSERT_EQ(entt::any_cast<int>(other), 2);
 }
@@ -247,7 +247,7 @@ TEST(Any, SBOSelfCopyAssignment) {
     ASSERT_TRUE(any);
     ASSERT_TRUE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::embedded);
-    ASSERT_EQ(any.type(), entt::type_id<int>());
+    ASSERT_EQ(any.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<int>(any), 2);
 }
@@ -262,7 +262,7 @@ TEST(Any, SBOMoveConstruction) {
     ASSERT_TRUE(other);
     ASSERT_TRUE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::embedded);
-    ASSERT_EQ(other.type(), entt::type_id<int>());
+    ASSERT_EQ(other.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<double>(&other), nullptr);
     ASSERT_EQ(entt::any_cast<int>(other), 2);
 }
@@ -278,7 +278,7 @@ TEST(Any, SBOMoveAssignment) {
     ASSERT_TRUE(other);
     ASSERT_TRUE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::embedded);
-    ASSERT_EQ(other.type(), entt::type_id<int>());
+    ASSERT_EQ(other.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<double>(&other), nullptr);
     ASSERT_EQ(entt::any_cast<int>(other), 2);
 }
@@ -292,7 +292,7 @@ TEST(AnyDeathTest, SBOSelfMoveAssignment) {
     ASSERT_FALSE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::empty);
-    ASSERT_EQ(any.type(), entt::type_id<void>());
+    ASSERT_EQ(any.info(), entt::type_id<void>());
     ASSERT_EQ(any.data(), nullptr);
 }
 
@@ -303,7 +303,7 @@ TEST(Any, SBODirectAssignment) {
     ASSERT_TRUE(any);
     ASSERT_TRUE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::embedded);
-    ASSERT_EQ(any.type(), entt::type_id<int>());
+    ASSERT_EQ(any.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<int>(any), 2);
 }
@@ -407,7 +407,7 @@ TEST(Any, NoSBOInPlaceConstruction) {
     ASSERT_TRUE(any);
     ASSERT_TRUE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::dynamic);
-    ASSERT_EQ(any.type(), entt::type_id<fat>());
+    ASSERT_EQ(any.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(any), (fat{.1, .2, .3, .4}));
 
@@ -416,7 +416,7 @@ TEST(Any, NoSBOInPlaceConstruction) {
     ASSERT_TRUE(other);
     ASSERT_FALSE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::ref);
-    ASSERT_EQ(other.type(), entt::type_id<fat>());
+    ASSERT_EQ(other.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<fat>(other), (fat{.1, .2, .3, .4}));
     ASSERT_EQ(other.data(), any.data());
 }
@@ -428,7 +428,7 @@ TEST(Any, NoSBOInPlaceNullptrConstruction) {
     ASSERT_FALSE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::empty);
-    ASSERT_EQ(any.type(), entt::type_id<void>());
+    ASSERT_EQ(any.info(), entt::type_id<void>());
 }
 
 TEST(Any, NoSBOInPlaceTypeConstruction) {
@@ -438,7 +438,7 @@ TEST(Any, NoSBOInPlaceTypeConstruction) {
     ASSERT_TRUE(any);
     ASSERT_TRUE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::dynamic);
-    ASSERT_EQ(any.type(), entt::type_id<fat>());
+    ASSERT_EQ(any.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(any), instance);
 
@@ -447,7 +447,7 @@ TEST(Any, NoSBOInPlaceTypeConstruction) {
     ASSERT_TRUE(other);
     ASSERT_FALSE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::ref);
-    ASSERT_EQ(other.type(), entt::type_id<fat>());
+    ASSERT_EQ(other.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<fat>(other), (fat{.1, .2, .3, .4}));
     ASSERT_EQ(other.data(), any.data());
 }
@@ -459,7 +459,7 @@ TEST(Any, NoSBOAsRefConstruction) {
     ASSERT_TRUE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::ref);
-    ASSERT_EQ(any.type(), entt::type_id<fat>());
+    ASSERT_EQ(any.info(), entt::type_id<fat>());
 
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<const fat>(&any), &instance);
@@ -478,7 +478,7 @@ TEST(Any, NoSBOAsRefConstruction) {
     ASSERT_TRUE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::ref);
-    ASSERT_EQ(any.type(), entt::type_id<fat>());
+    ASSERT_EQ(any.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<fat>(&any), &instance);
 
     auto other = any.as_ref();
@@ -486,7 +486,7 @@ TEST(Any, NoSBOAsRefConstruction) {
     ASSERT_TRUE(other);
     ASSERT_FALSE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::ref);
-    ASSERT_EQ(other.type(), entt::type_id<fat>());
+    ASSERT_EQ(other.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<fat>(other), (fat{.1, .2, .3, .4}));
     ASSERT_EQ(other.data(), any.data());
 }
@@ -498,7 +498,7 @@ TEST(Any, NoSBOAsConstRefConstruction) {
     ASSERT_TRUE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::cref);
-    ASSERT_EQ(any.type(), entt::type_id<fat>());
+    ASSERT_EQ(any.info(), entt::type_id<fat>());
 
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<const fat>(&any), &instance);
@@ -517,7 +517,7 @@ TEST(Any, NoSBOAsConstRefConstruction) {
     ASSERT_TRUE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::cref);
-    ASSERT_EQ(any.type(), entt::type_id<fat>());
+    ASSERT_EQ(any.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<const fat>(&any), &instance);
 
     auto other = any.as_ref();
@@ -525,7 +525,7 @@ TEST(Any, NoSBOAsConstRefConstruction) {
     ASSERT_TRUE(other);
     ASSERT_FALSE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::cref);
-    ASSERT_EQ(other.type(), entt::type_id<fat>());
+    ASSERT_EQ(other.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<fat>(other), (fat{.1, .2, .3, .4}));
     ASSERT_EQ(other.data(), any.data());
 }
@@ -539,7 +539,7 @@ TEST(Any, NoSBOCopyConstruction) {
     ASSERT_TRUE(other);
     ASSERT_TRUE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::dynamic);
-    ASSERT_EQ(other.type(), entt::type_id<fat>());
+    ASSERT_EQ(other.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<double>(&other), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(other), instance);
 }
@@ -555,7 +555,7 @@ TEST(Any, NoSBOCopyAssignment) {
     ASSERT_TRUE(other);
     ASSERT_TRUE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::dynamic);
-    ASSERT_EQ(other.type(), entt::type_id<fat>());
+    ASSERT_EQ(other.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<double>(&other), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(other), instance);
 }
@@ -570,7 +570,7 @@ TEST(Any, NoSBOSelfCopyAssignment) {
     ASSERT_TRUE(any);
     ASSERT_TRUE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::dynamic);
-    ASSERT_EQ(any.type(), entt::type_id<fat>());
+    ASSERT_EQ(any.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(any), instance);
 }
@@ -586,7 +586,7 @@ TEST(Any, NoSBOMoveConstruction) {
     ASSERT_TRUE(other);
     ASSERT_TRUE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::dynamic);
-    ASSERT_EQ(other.type(), entt::type_id<fat>());
+    ASSERT_EQ(other.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<double>(&other), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(other), instance);
 }
@@ -603,7 +603,7 @@ TEST(Any, NoSBOMoveAssignment) {
     ASSERT_TRUE(other);
     ASSERT_TRUE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::dynamic);
-    ASSERT_EQ(other.type(), entt::type_id<fat>());
+    ASSERT_EQ(other.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<double>(&other), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(other), instance);
 }
@@ -618,7 +618,7 @@ TEST(AnyDeathTest, NoSBOSelfMoveAssignment) {
     ASSERT_FALSE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::empty);
-    ASSERT_EQ(any.type(), entt::type_id<void>());
+    ASSERT_EQ(any.info(), entt::type_id<void>());
     ASSERT_EQ(any.data(), nullptr);
 }
 
@@ -630,7 +630,7 @@ TEST(Any, NoSBODirectAssignment) {
     ASSERT_TRUE(any);
     ASSERT_TRUE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::dynamic);
-    ASSERT_EQ(any.type(), entt::type_id<fat>());
+    ASSERT_EQ(any.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(any), instance);
 }
@@ -747,7 +747,7 @@ TEST(Any, VoidInPlaceTypeConstruction) {
     ASSERT_FALSE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::empty);
-    ASSERT_EQ(any.type(), entt::type_id<void>());
+    ASSERT_EQ(any.info(), entt::type_id<void>());
     ASSERT_EQ(entt::any_cast<int>(&any), nullptr);
 }
 
@@ -759,7 +759,7 @@ TEST(Any, VoidCopyConstruction) {
     ASSERT_FALSE(other);
     ASSERT_FALSE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::empty);
-    ASSERT_EQ(other.type(), entt::type_id<void>());
+    ASSERT_EQ(other.info(), entt::type_id<void>());
     ASSERT_EQ(entt::any_cast<int>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<double>(&other), nullptr);
 }
@@ -774,7 +774,7 @@ TEST(Any, VoidCopyAssignment) {
     ASSERT_FALSE(other);
     ASSERT_FALSE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::empty);
-    ASSERT_EQ(other.type(), entt::type_id<void>());
+    ASSERT_EQ(other.info(), entt::type_id<void>());
     ASSERT_EQ(entt::any_cast<int>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<double>(&other), nullptr);
 }
@@ -788,7 +788,7 @@ TEST(Any, VoidSelfCopyAssignment) {
     ASSERT_FALSE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::empty);
-    ASSERT_EQ(any.type(), entt::type_id<void>());
+    ASSERT_EQ(any.info(), entt::type_id<void>());
     ASSERT_EQ(entt::any_cast<int>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
 }
@@ -803,7 +803,7 @@ TEST(Any, VoidMoveConstruction) {
     ASSERT_FALSE(other);
     ASSERT_FALSE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::empty);
-    ASSERT_EQ(other.type(), entt::type_id<void>());
+    ASSERT_EQ(other.info(), entt::type_id<void>());
     ASSERT_EQ(entt::any_cast<double>(&other), nullptr);
 }
 
@@ -818,7 +818,7 @@ TEST(Any, VoidMoveAssignment) {
     ASSERT_FALSE(other);
     ASSERT_FALSE(other.owner());
     ASSERT_EQ(other.policy(), entt::any_policy::empty);
-    ASSERT_EQ(other.type(), entt::type_id<void>());
+    ASSERT_EQ(other.info(), entt::type_id<void>());
     ASSERT_EQ(entt::any_cast<double>(&other), nullptr);
 }
 
@@ -831,7 +831,7 @@ TEST(AnyDeathTest, VoidSelfMoveAssignment) {
     ASSERT_FALSE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::empty);
-    ASSERT_EQ(any.type(), entt::type_id<void>());
+    ASSERT_EQ(any.info(), entt::type_id<void>());
     ASSERT_EQ(any.data(), nullptr);
 }
 
@@ -919,7 +919,7 @@ TEST(Any, Emplace) {
     ASSERT_TRUE(any);
     ASSERT_TRUE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::embedded);
-    ASSERT_EQ(any.type(), entt::type_id<int>());
+    ASSERT_EQ(any.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<double>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<int>(any), 2);
 }
@@ -931,7 +931,7 @@ TEST(Any, EmplaceVoid) {
     ASSERT_FALSE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::empty);
-    ASSERT_EQ(any.type(), entt::type_id<void>());
+    ASSERT_EQ(any.info(), entt::type_id<void>());
 }
 
 TEST(Any, Reset) {
@@ -940,14 +940,14 @@ TEST(Any, Reset) {
     ASSERT_TRUE(any);
     ASSERT_TRUE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::embedded);
-    ASSERT_EQ(any.type(), entt::type_id<int>());
+    ASSERT_EQ(any.info(), entt::type_id<int>());
 
     any.reset();
 
     ASSERT_FALSE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::empty);
-    ASSERT_EQ(any.type(), entt::type_id<void>());
+    ASSERT_EQ(any.info(), entt::type_id<void>());
 
     int value = 2;
     any.emplace<int &>(value);
@@ -955,14 +955,14 @@ TEST(Any, Reset) {
     ASSERT_TRUE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::ref);
-    ASSERT_EQ(any.type(), entt::type_id<int>());
+    ASSERT_EQ(any.info(), entt::type_id<int>());
 
     any.reset();
 
     ASSERT_FALSE(any);
     ASSERT_FALSE(any.owner());
     ASSERT_EQ(any.policy(), entt::any_policy::empty);
-    ASSERT_EQ(any.type(), entt::type_id<void>());
+    ASSERT_EQ(any.info(), entt::type_id<void>());
 }
 
 TEST(Any, SBOSwap) {
@@ -977,8 +977,8 @@ TEST(Any, SBOSwap) {
     ASSERT_EQ(lhs.policy(), entt::any_policy::embedded);
     ASSERT_EQ(rhs.policy(), entt::any_policy::embedded);
 
-    ASSERT_EQ(lhs.type(), entt::type_id<int>());
-    ASSERT_EQ(rhs.type(), entt::type_id<char>());
+    ASSERT_EQ(lhs.info(), entt::type_id<int>());
+    ASSERT_EQ(rhs.info(), entt::type_id<char>());
     ASSERT_EQ(entt::any_cast<char>(&lhs), nullptr);
     ASSERT_EQ(entt::any_cast<int>(&rhs), nullptr);
     ASSERT_EQ(entt::any_cast<int>(lhs), 2);
@@ -1029,8 +1029,8 @@ TEST(Any, SBOWithNoSBOSwap) {
     ASSERT_EQ(lhs.policy(), entt::any_policy::embedded);
     ASSERT_EQ(rhs.policy(), entt::any_policy::dynamic);
 
-    ASSERT_EQ(lhs.type(), entt::type_id<char>());
-    ASSERT_EQ(rhs.type(), entt::type_id<fat>());
+    ASSERT_EQ(lhs.info(), entt::type_id<char>());
+    ASSERT_EQ(rhs.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<fat>(&lhs), nullptr);
     ASSERT_EQ(entt::any_cast<char>(&rhs), nullptr);
     ASSERT_EQ(entt::any_cast<char>(lhs), 'c');
@@ -1050,8 +1050,8 @@ TEST(Any, SBOWithRefSwap) {
     ASSERT_EQ(lhs.policy(), entt::any_policy::embedded);
     ASSERT_EQ(rhs.policy(), entt::any_policy::ref);
 
-    ASSERT_EQ(lhs.type(), entt::type_id<char>());
-    ASSERT_EQ(rhs.type(), entt::type_id<int>());
+    ASSERT_EQ(lhs.info(), entt::type_id<char>());
+    ASSERT_EQ(rhs.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<int>(&lhs), nullptr);
     ASSERT_EQ(entt::any_cast<char>(&rhs), nullptr);
     ASSERT_EQ(entt::any_cast<char>(lhs), 'c');
@@ -1072,8 +1072,8 @@ TEST(Any, SBOWithConstRefSwap) {
     ASSERT_EQ(lhs.policy(), entt::any_policy::embedded);
     ASSERT_EQ(rhs.policy(), entt::any_policy::cref);
 
-    ASSERT_EQ(lhs.type(), entt::type_id<char>());
-    ASSERT_EQ(rhs.type(), entt::type_id<int>());
+    ASSERT_EQ(lhs.info(), entt::type_id<char>());
+    ASSERT_EQ(rhs.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<int>(&lhs), nullptr);
     ASSERT_EQ(entt::any_cast<char>(&rhs), nullptr);
     ASSERT_EQ(entt::any_cast<char>(lhs), 'c');
@@ -1091,7 +1091,7 @@ TEST(Any, SBOWithEmptySwap) {
     ASSERT_FALSE(lhs);
     ASSERT_FALSE(lhs.owner());
     ASSERT_EQ(lhs.policy(), entt::any_policy::empty);
-    ASSERT_EQ(rhs.type(), entt::type_id<char>());
+    ASSERT_EQ(rhs.info(), entt::type_id<char>());
     ASSERT_EQ(entt::any_cast<char>(&lhs), nullptr);
     ASSERT_EQ(entt::any_cast<double>(&rhs), nullptr);
     ASSERT_EQ(entt::any_cast<char>(rhs), 'c');
@@ -1101,7 +1101,7 @@ TEST(Any, SBOWithEmptySwap) {
     ASSERT_FALSE(rhs);
     ASSERT_TRUE(lhs.owner());
     ASSERT_EQ(lhs.policy(), entt::any_policy::embedded);
-    ASSERT_EQ(lhs.type(), entt::type_id<char>());
+    ASSERT_EQ(lhs.info(), entt::type_id<char>());
     ASSERT_EQ(entt::any_cast<double>(&lhs), nullptr);
     ASSERT_EQ(entt::any_cast<char>(&rhs), nullptr);
     ASSERT_EQ(entt::any_cast<char>(lhs), 'c');
@@ -1116,7 +1116,7 @@ TEST(Any, SBOWithVoidSwap) {
     ASSERT_FALSE(lhs);
     ASSERT_FALSE(lhs.owner());
     ASSERT_EQ(lhs.policy(), entt::any_policy::empty);
-    ASSERT_EQ(rhs.type(), entt::type_id<char>());
+    ASSERT_EQ(rhs.info(), entt::type_id<char>());
     ASSERT_EQ(entt::any_cast<char>(&lhs), nullptr);
     ASSERT_EQ(entt::any_cast<double>(&rhs), nullptr);
     ASSERT_EQ(entt::any_cast<char>(rhs), 'c');
@@ -1126,7 +1126,7 @@ TEST(Any, SBOWithVoidSwap) {
     ASSERT_FALSE(rhs);
     ASSERT_TRUE(lhs.owner());
     ASSERT_EQ(lhs.policy(), entt::any_policy::embedded);
-    ASSERT_EQ(lhs.type(), entt::type_id<char>());
+    ASSERT_EQ(lhs.info(), entt::type_id<char>());
     ASSERT_EQ(entt::any_cast<double>(&lhs), nullptr);
     ASSERT_EQ(entt::any_cast<char>(&rhs), nullptr);
     ASSERT_EQ(entt::any_cast<char>(lhs), 'c');
@@ -1145,8 +1145,8 @@ TEST(Any, NoSBOWithRefSwap) {
     ASSERT_EQ(lhs.policy(), entt::any_policy::dynamic);
     ASSERT_EQ(rhs.policy(), entt::any_policy::ref);
 
-    ASSERT_EQ(lhs.type(), entt::type_id<fat>());
-    ASSERT_EQ(rhs.type(), entt::type_id<int>());
+    ASSERT_EQ(lhs.info(), entt::type_id<fat>());
+    ASSERT_EQ(rhs.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<int>(&lhs), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(&rhs), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(lhs), (fat{.1, .2, .3, .4}));
@@ -1167,8 +1167,8 @@ TEST(Any, NoSBOWithConstRefSwap) {
     ASSERT_EQ(lhs.policy(), entt::any_policy::dynamic);
     ASSERT_EQ(rhs.policy(), entt::any_policy::cref);
 
-    ASSERT_EQ(lhs.type(), entt::type_id<fat>());
-    ASSERT_EQ(rhs.type(), entt::type_id<int>());
+    ASSERT_EQ(lhs.info(), entt::type_id<fat>());
+    ASSERT_EQ(rhs.info(), entt::type_id<int>());
     ASSERT_EQ(entt::any_cast<int>(&lhs), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(&rhs), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(lhs), (fat{.1, .2, .3, .4}));
@@ -1186,7 +1186,7 @@ TEST(Any, NoSBOWithEmptySwap) {
     ASSERT_FALSE(lhs);
     ASSERT_FALSE(lhs.owner());
     ASSERT_EQ(lhs.policy(), entt::any_policy::empty);
-    ASSERT_EQ(rhs.type(), entt::type_id<fat>());
+    ASSERT_EQ(rhs.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<fat>(&lhs), nullptr);
     ASSERT_EQ(entt::any_cast<double>(&rhs), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(rhs), (fat{.1, .2, .3, .4}));
@@ -1196,7 +1196,7 @@ TEST(Any, NoSBOWithEmptySwap) {
     ASSERT_FALSE(rhs);
     ASSERT_TRUE(lhs.owner());
     ASSERT_EQ(lhs.policy(), entt::any_policy::dynamic);
-    ASSERT_EQ(lhs.type(), entt::type_id<fat>());
+    ASSERT_EQ(lhs.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<double>(&lhs), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(&rhs), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(lhs), (fat{.1, .2, .3, .4}));
@@ -1211,7 +1211,7 @@ TEST(Any, NoSBOWithVoidSwap) {
     ASSERT_FALSE(lhs);
     ASSERT_FALSE(lhs.owner());
     ASSERT_EQ(lhs.policy(), entt::any_policy::empty);
-    ASSERT_EQ(rhs.type(), entt::type_id<fat>());
+    ASSERT_EQ(rhs.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<fat>(&lhs), nullptr);
     ASSERT_EQ(entt::any_cast<double>(&rhs), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(rhs), (fat{.1, .2, .3, .4}));
@@ -1221,7 +1221,7 @@ TEST(Any, NoSBOWithVoidSwap) {
     ASSERT_FALSE(rhs);
     ASSERT_TRUE(lhs.owner());
     ASSERT_EQ(lhs.policy(), entt::any_policy::dynamic);
-    ASSERT_EQ(lhs.type(), entt::type_id<fat>());
+    ASSERT_EQ(lhs.info(), entt::type_id<fat>());
     ASSERT_EQ(entt::any_cast<double>(&lhs), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(&rhs), nullptr);
     ASSERT_EQ(entt::any_cast<fat>(lhs), (fat{.1, .2, .3, .4}));
@@ -1552,7 +1552,7 @@ TEST(Any, NonCopyableType) {
 
     ASSERT_EQ(any.policy(), entt::any_policy::embedded);
     ASSERT_EQ(other.policy(), entt::any_policy::cref);
-    ASSERT_EQ(any.type(), other.type());
+    ASSERT_EQ(any.info(), other.info());
 
     ASSERT_FALSE(any.assign(other));
     ASSERT_FALSE(any.assign(std::move(other)));
@@ -1609,7 +1609,7 @@ TEST(Any, NonMovableType) {
 
     ASSERT_EQ(any.policy(), entt::any_policy::dynamic);
     ASSERT_EQ(other.policy(), entt::any_policy::dynamic);
-    ASSERT_EQ(any.type(), other.type());
+    ASSERT_EQ(any.info(), other.info());
 
     ASSERT_TRUE(any.assign(other));
     ASSERT_TRUE(any.assign(std::move(other)));
@@ -1646,7 +1646,7 @@ TEST(Any, Array) {
     ASSERT_FALSE(copy);
 
     // NOLINTBEGIN(*-avoid-c-arrays)
-    ASSERT_EQ(any.type(), entt::type_id<int[1]>());
+    ASSERT_EQ(any.info(), entt::type_id<int[1]>());
     ASSERT_NE(entt::any_cast<int[1]>(&any), nullptr);
     ASSERT_EQ(entt::any_cast<int[2]>(&any), nullptr);
     // NOLINTEND(*-avoid-c-arrays)
@@ -1677,8 +1677,8 @@ TEST(Any, CopyMoveReference) {
     ASSERT_EQ(move.policy(), entt::any_policy::ref);
     ASSERT_EQ(copy.policy(), entt::any_policy::embedded);
 
-    ASSERT_EQ(move.type(), entt::type_id<int>());
-    ASSERT_EQ(copy.type(), entt::type_id<int>());
+    ASSERT_EQ(move.info(), entt::type_id<int>());
+    ASSERT_EQ(copy.info(), entt::type_id<int>());
 
     ASSERT_EQ(std::as_const(move).data(), &value);
     ASSERT_NE(std::as_const(copy).data(), &value);
@@ -1710,8 +1710,8 @@ TEST(Any, CopyMoveConstReference) {
     ASSERT_EQ(move.policy(), entt::any_policy::cref);
     ASSERT_EQ(copy.policy(), entt::any_policy::embedded);
 
-    ASSERT_EQ(move.type(), entt::type_id<int>());
-    ASSERT_EQ(copy.type(), entt::type_id<int>());
+    ASSERT_EQ(move.info(), entt::type_id<int>());
+    ASSERT_EQ(copy.info(), entt::type_id<int>());
 
     ASSERT_EQ(std::as_const(move).data(), &value);
     ASSERT_NE(std::as_const(copy).data(), &value);
@@ -1792,13 +1792,13 @@ TEST(Any, DeducedArrayType) {
     entt::any any{"array of char"};
 
     ASSERT_TRUE(any);
-    ASSERT_EQ(any.type(), entt::type_id<const char *>());
+    ASSERT_EQ(any.info(), entt::type_id<const char *>());
     ASSERT_EQ((std::strcmp("array of char", entt::any_cast<const char *>(any))), 0);
 
     any = "another array of char";
 
     ASSERT_TRUE(any);
-    ASSERT_EQ(any.type(), entt::type_id<const char *>());
+    ASSERT_EQ(any.info(), entt::type_id<const char *>());
     ASSERT_EQ((std::strcmp("another array of char", entt::any_cast<const char *>(any))), 0);
 }
 
@@ -1807,6 +1807,6 @@ TEST(Any, ClassLevelNewDelete) {
     entt::any any{std::in_place_type<test::new_delete>, *std::make_unique<test::new_delete>(test::new_delete{3})};
 
     ASSERT_TRUE(any);
-    ASSERT_EQ(any.type(), entt::type_id<test::new_delete>());
+    ASSERT_EQ(any.info(), entt::type_id<test::new_delete>());
     ASSERT_EQ(entt::any_cast<const test::new_delete &>(any).value, 3);
 }