Przeglądaj źródła

meta: revert rebind meta_any with context(ctx), I prefer the rebinding constructors actually

Michele Caini 1 rok temu
rodzic
commit
8c55c09c3f
3 zmienionych plików z 2 dodań i 17 usunięć
  1. 0 1
      TODO
  2. 0 10
      src/entt/meta/meta.hpp
  3. 2 6
      test/entt/meta/meta_any.cpp

+ 0 - 1
TODO

@@ -35,4 +35,3 @@ TODO:
 * any cdynamic to support const ownership construction
 * allow passing arguments to meta setter/getter (we can fallback on meta invoke probably)
 * meta: review/update rebind policy for handles and arguments
-* meta: deprecate rebinding ctors for meta any/handle

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

@@ -650,16 +650,6 @@ public:
         return *ctx;
     }
 
-    /**
-     * @brief Returns the underlying meta context.
-     * @return The underlying meta context.
-     */
-    void context(const meta_ctx &area) noexcept {
-        if(ctx = &area; node.resolve != nullptr) {
-            node = node.resolve(internal::meta_context::from(*ctx));
-        }
-    }
-
 private:
     any storage;
     const meta_ctx *ctx{&locator<meta_ctx>::value_or()};

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

@@ -137,18 +137,14 @@ TEST_F(MetaAny, Empty) {
 }
 
 TEST_F(MetaAny, Context) {
-    using namespace entt::literals;
-
-    entt::meta_any any{std::in_place_type<clazz>};
+    entt::meta_any any{};
     const entt::meta_ctx ctx{};
 
-    ASSERT_TRUE(any.type().data("value"_hs));
     ASSERT_EQ(&any.context(), &entt::locator<entt::meta_ctx>::value_or());
     ASSERT_NE(&any.context(), &ctx);
 
-    any.context(ctx);
+    any = entt::meta_any{entt::meta_ctx_arg, ctx};
 
-    ASSERT_FALSE(any.type().data("value"_hs));
     ASSERT_NE(&any.context(), &entt::locator<entt::meta_ctx>::value_or());
     ASSERT_EQ(&any.context(), &ctx);
 }