Kaynağa Gözat

meta: drop deprecated accessors on meta_any

Michele Caini 1 yıl önce
ebeveyn
işleme
4027bfff69
2 değiştirilmiş dosya ile 6 ekleme ve 24 silme
  1. 0 18
      src/entt/meta/meta.hpp
  2. 6 6
      test/entt/meta/meta_any.cpp

+ 0 - 18
src/entt/meta/meta.hpp

@@ -387,16 +387,6 @@ public:
     /*! @copydoc any::type */
     [[nodiscard]] inline meta_type type() const noexcept;
 
-    /*! @copydoc any::data */
-    [[nodiscard]] [[deprecated("use ::base().data() instead")]] const void *data() const noexcept {
-        return storage.data();
-    }
-
-    /*! @copydoc any::data */
-    [[nodiscard]] [[deprecated("no longer supported, use ::base().data() for const access")]] void *data() noexcept {
-        return storage.data();
-    }
-
     /**
      * @brief Invokes the underlying function, if possible.
      * @tparam Args Types of arguments to use to invoke the function.
@@ -627,14 +617,6 @@ public:
         return meta_any{*this, storage.as_ref()};
     }
 
-    /**
-     * @brief Returns the current mode of a meta any object.
-     * @return The current mode of the meta any object.
-     */
-    [[nodiscard]] [[deprecated("use ::base().policy() instead")]] any_policy policy() const noexcept {
-        return storage.policy();
-    }
-
     /**
      * @brief Returns the underlying storage.
      * @return The underlyig storage.

+ 6 - 6
test/entt/meta/meta_any.cpp

@@ -154,10 +154,10 @@ TEST_F(MetaAny, SBO) {
 
     ASSERT_TRUE(any);
     ASSERT_TRUE(any.base().owner());
-    ASSERT_EQ(any.policy(), entt::any_policy::embedded);
+    ASSERT_EQ(any.base().policy(), entt::any_policy::embedded);
     ASSERT_FALSE(any.try_cast<std::size_t>());
     ASSERT_EQ(any.cast<char>(), 'c');
-    ASSERT_NE(any.data(), nullptr);
+    ASSERT_NE(any.base().data(), nullptr);
     ASSERT_EQ(any, entt::meta_any{'c'});
     ASSERT_NE(entt::meta_any{'h'}, any);
 }
@@ -168,10 +168,10 @@ TEST_F(MetaAny, NoSBO) {
 
     ASSERT_TRUE(any);
     ASSERT_TRUE(any.base().owner());
-    ASSERT_EQ(any.policy(), entt::any_policy::dynamic);
+    ASSERT_EQ(any.base().policy(), entt::any_policy::dynamic);
     ASSERT_FALSE(any.try_cast<std::size_t>());
     ASSERT_EQ(any.cast<fat>(), instance);
-    ASSERT_NE(any.data(), nullptr);
+    ASSERT_NE(any.base().data(), nullptr);
     ASSERT_EQ(any, entt::meta_any{instance});
     ASSERT_NE(any, fat{});
 }
@@ -194,7 +194,7 @@ TEST_F(MetaAny, SBOInPlaceConstruction) {
 
     ASSERT_TRUE(other);
     ASSERT_FALSE(other.base().owner());
-    ASSERT_EQ(other.policy(), entt::any_policy::ref);
+    ASSERT_EQ(other.base().policy(), entt::any_policy::ref);
     ASSERT_FALSE(other.try_cast<std::size_t>());
     ASSERT_EQ(other.cast<int>(), 2);
     ASSERT_NE(other.base().data(), nullptr);
@@ -526,7 +526,7 @@ TEST_F(MetaAny, NoSBOInPlaceConstruction) {
 
     ASSERT_TRUE(other);
     ASSERT_FALSE(other.base().owner());
-    ASSERT_EQ(other.policy(), entt::any_policy::ref);
+    ASSERT_EQ(other.base().policy(), entt::any_policy::ref);
     ASSERT_FALSE(other.try_cast<std::size_t>());
     ASSERT_EQ(other.cast<fat>(), instance);
     ASSERT_NE(other.base().data(), nullptr);