Bläddra i källkod

meta:
* removed meta_ctor, no alternatives provided
* removed meta_type::ctor overloads, no alternatives provided

Michele Caini 4 år sedan
förälder
incheckning
36627dbe78

+ 7 - 33
docs/md/meta.md

@@ -268,19 +268,6 @@ Refer to the inline documentation for all the details.
 
 The meta objects that compose a meta type are accessed in the following ways:
 
-* _Meta constructors_. They are accessed by types of arguments:
-
-  ```cpp
-  auto ctor = entt::resolve<my_type>().ctor<int, char>();
-  ```
-
-  The returned type is `meta_ctor` and may be invalid if there is no constructor
-  that accepts the supplied arguments or at least some types from which they are
-  derived or to which they can be converted.<br/>
-  A meta constructor offers an API to know the number of its arguments and their
-  expected meta types. Furthermor, it's possible to invoke it and therefore to
-  construct new instances of the underlying type.
-
 * _Meta data_. They are accessed by _name_:
 
   ```cpp
@@ -777,14 +764,7 @@ them.
 For this reason and only for default constructible types, default constructors
 are automatically defined and associated with their meta types, whether they are
 explicitly or implicitly generated.<br/>
-Therefore, it won't be necessary to do this in order to construct an integer
-from its meta type:
-
-```cpp
-entt::meta<int>().ctor<>();
-```
-
-Instead, just do this:
+Therefore, this is all is needed to construct an integer from its meta type:
 
 ```cpp
 entt::resolve<int>().construct();
@@ -794,17 +774,7 @@ Where the meta type can be for example the one returned from a meta container,
 useful for building keys without knowing or having to register the actual types.
 
 In all cases, when users register default constructors, they are preferred both
-during searches and when the `construct` member function is invoked.<br/>
-Moreover, implicitly generated default constructors are never returned when
-iterating registered constructors nor when looking up constructors from meta
-types:
-
-```cpp
-entt::meta_ctor ctor = entt::resolve<int>().ctor<>();
-```
-
-In other terms, `ctor` is an invalid meta object unless users explicitly
-registered a meta constructor that takes no arguments for the `int` type.
+during searches and when the `construct` member function is invoked.
 
 ## Policies: the more, the less
 
@@ -829,9 +799,11 @@ There are a few alternatives available at the moment:
 * The _as-void_ policy, associated with the type `entt::as_void_t`.<br/>
   Its purpose is to discard the return value of a meta object, whatever it is,
   thus making it appear as if its type were `void`:
+
   ```cpp
   entt::meta<my_type>().func<&my_type::member_function, entt::as_void_t>("member"_hs);
   ```
+
   If the use with functions is obvious, it must be said that it's also possible
   to use this policy with constructors and data members. In the first case, the
   constructor will be invoked but the returned wrapper will actually be empty.
@@ -843,9 +815,11 @@ There are a few alternatives available at the moment:
   Accessing the object contained in the wrapper for which the _reference_ was
   requested will make it possible to directly access the instance used to
   initialize the wrapper itself:
+
   ```cpp
   entt::meta<my_type>().data<&my_type::data_member, entt::as_ref_t>("member"_hs);
   ```
+
   These policies work with constructors (for example, when objects are taken
   from an external container rather than created on demand), data members and
   functions in general.<br/>
@@ -946,7 +920,7 @@ once. In this case, properties in the key/value form aren't allowed, since they
 would be interpreted as two different properties rather than a single one.
 
 The meta objects for which properties are supported are currently meta types,
-meta constructors, meta data and meta functions.<br/>
+meta data and meta functions.<br/>
 These types also offer a couple of member functions named `prop` to iterate all
 properties at once or to search a specific property by key:
 

+ 3 - 5
src/entt/meta/factory.hpp

@@ -319,7 +319,6 @@ public:
         static_assert(std::is_same_v<std::decay_t<typename descriptor::return_type>, Type>, "The function doesn't return an object of the required type");
 
         static internal::meta_ctor_node node{
-            nullptr,
             nullptr,
             descriptor::args_type::size,
             &meta_arg<typename descriptor::args_type>,
@@ -327,7 +326,7 @@ public:
         };
 
         link_ctor_if_required(node);
-        return meta_factory<Type, std::integral_constant<decltype(Candidate), Candidate>>{&node.prop};
+        return meta_factory<Type>{};
     }
 
     /**
@@ -345,7 +344,6 @@ public:
         using descriptor = meta_function_helper_t<Type, Type(*)(Args...)>;
 
         static internal::meta_ctor_node node{
-            nullptr,
             nullptr,
             descriptor::args_type::size,
             &meta_arg<typename descriptor::args_type>,
@@ -353,7 +351,7 @@ public:
         };
 
         link_ctor_if_required(node);
-        return meta_factory<Type, Type(Args...)>{&node.prop};
+        return meta_factory<Type>{};
     }
 
     /**
@@ -535,7 +533,7 @@ inline void meta_reset(const id_type id) ENTT_NOEXCEPT {
             clear_chain(&node->prop);
             clear_chain(&node->base);
             clear_chain(&node->conv);
-            clear_chain(&node->ctor, &internal::meta_ctor_node::prop);
+            clear_chain(&node->ctor);
             clear_chain(&node->data, &internal::meta_data_node::prop);
             clear_chain(&node->func, &internal::meta_func_node::prop);
 

+ 0 - 3
src/entt/meta/fwd.hpp

@@ -20,9 +20,6 @@ struct meta_handle;
 struct meta_prop;
 
 
-struct meta_ctor;
-
-
 struct meta_data;
 
 

+ 6 - 129
src/entt/meta/meta.hpp

@@ -724,98 +724,6 @@ private:
 };
 
 
-/*! @brief Opaque wrapper for constructors. */
-struct meta_ctor {
-    /*! @brief Node type. */
-    using node_type = internal::meta_ctor_node;
-    /*! @brief Unsigned integer type. */
-    using size_type = typename node_type::size_type;
-
-    /*! @copydoc meta_prop::meta_prop */
-    meta_ctor(const node_type *curr = nullptr) ENTT_NOEXCEPT
-        : node{curr}
-    {}
-
-    /**
-     * @brief Returns the number of arguments accepted by a constructor.
-     * @return The number of arguments accepted by the constructor.
-     */
-    [[nodiscard]] size_type arity() const ENTT_NOEXCEPT {
-        return node->arity;
-    }
-
-    /**
-     * @brief Returns the type of the i-th argument of a constructor.
-     * @param index Index of the argument of which to return the type.
-     * @return The type of the i-th argument of a constructor.
-     */
-    [[nodiscard]] meta_type arg(const size_type index) const ENTT_NOEXCEPT;
-
-    /**
-     * @brief Creates an instance of the underlying type, if possible.
-     *
-     * Parameters are such that a cast or conversion to the required types is
-     * possible. Otherwise, an empty and thus invalid wrapper is returned.
-     *
-     * @param args Parameters to use to construct the instance.
-     * @param sz Number of parameters to use to construct the instance.
-     * @return A wrapper containing the new instance, if any.
-     */
-    [[nodiscard]] meta_any invoke(meta_any * const args, const size_type sz) const {
-        return sz == arity() ? node->invoke(args) : meta_any{};
-    }
-
-    /**
-     * @copybrief invoke
-     *
-     * @sa invoke
-     *
-     * @tparam Args Types of arguments to use to construct the instance.
-     * @param args Parameters to use to construct the instance.
-     * @return A wrapper containing the new instance, if any.
-     */
-    template<typename... Args>
-    [[nodiscard]] meta_any invoke([[maybe_unused]] Args &&... args) const {
-        meta_any arguments[sizeof...(Args) + 1u]{std::forward<Args>(args)...};
-        return invoke(arguments, sizeof...(Args));
-    }
-
-    /**
-     * @brief Returns a range to visit registered meta properties.
-     * @return An iterable range to visit registered meta properties.
-     */
-    [[nodiscard]] meta_range<meta_prop> prop() const ENTT_NOEXCEPT {
-        return node->prop;
-    }
-
-    /**
-     * @brief Lookup function for registered meta properties.
-     * @param key The key to use to search for a property.
-     * @return The registered meta property for the given key, if any.
-     */
-    [[nodiscard]] meta_prop prop(meta_any key) const {
-        for(auto curr: prop()) {
-            if(curr.key() == key) {
-                return curr;
-            }
-        }
-
-        return nullptr;
-    }
-
-    /**
-     * @brief Returns true if an object is valid, false otherwise.
-     * @return True if the object is valid, false otherwise.
-     */
-    [[nodiscard]] explicit operator bool() const ENTT_NOEXCEPT {
-        return !(node == nullptr);
-    }
-
-private:
-    const node_type *node;
-};
-
-
 /*! @brief Opaque wrapper for data members. */
 struct meta_data {
     /*! @brief Node type. */
@@ -882,7 +790,10 @@ struct meta_data {
         return node->get(std::move(instance));
     }
 
-    /*! @copydoc meta_ctor::prop */
+    /**
+     * @brief Returns a range to visit registered meta properties.
+     * @return An iterable range to visit registered meta properties.
+     */
     [[nodiscard]] meta_range<meta_prop> prop() const ENTT_NOEXCEPT {
         return node->prop;
     }
@@ -1004,7 +915,7 @@ struct meta_func {
         return invoke(std::move(instance), arguments, sizeof...(Args));
     }
 
-    /*! @copydoc meta_ctor::prop */
+    /*! @copydoc meta_data::prop */
     [[nodiscard]] meta_range<meta_prop> prop() const ENTT_NOEXCEPT {
         return node->prop;
     }
@@ -1039,17 +950,6 @@ private:
 
 /*! @brief Opaque wrapper for types. */
 class meta_type {
-    template<typename... Args, auto... Index>
-    [[nodiscard]] static const internal::meta_ctor_node * ctor(const internal::meta_ctor_node *curr, std::index_sequence<Index...>) {
-        for(; curr; curr = curr->next) {
-            if(curr->arity == sizeof...(Args) && (internal::can_cast_or_convert(internal::meta_node<std::remove_const_t<std::remove_reference_t<Args>>>::resolve(), curr->arg(Index).node) && ...)) {
-                return curr;
-            }
-        }
-
-        return nullptr;
-    }
-
     template<auto Member, typename Pred>
     const auto * lookup(meta_any * const args, const typename internal::meta_type_node::size_type sz, Pred pred) const {
         std::decay_t<decltype(node->*Member)> candidate{};
@@ -1061,7 +961,7 @@ class meta_type {
                 size_type direct{};
                 size_type ext{};
 
-                for(size_type next{}; next < sz && next == (direct + ext); ++next) {
+                for(size_type next{}; next < sz && next == (direct + ext) && args[next]; ++next) {
                     const auto type = args[next].type();
                     const auto other = curr->arg(next);
                     type.info() == other.info() ? ++direct : (ext += internal::can_cast_or_convert(type.node, other.node));
@@ -1248,24 +1148,6 @@ public:
         return internal::visit<&node_type::base>([id](const auto *curr) { return curr->type->id == id; }, node);
     }
 
-    /**
-     * @brief Returns a range to visit registered top-level constructors.
-     * @return An iterable range to visit registered top-level constructors.
-     */
-    [[nodiscard]] meta_range<meta_ctor> ctor() const ENTT_NOEXCEPT {
-        return node->ctor;
-    }
-
-    /**
-     * @brief Lookup function for registered meta constructors.
-     * @tparam Args Constructor arguments.
-     * @return The registered meta constructor for the given arguments, if any.
-     */
-    template<typename... Args>
-    [[nodiscard]] meta_ctor ctor() const {
-        return ctor<Args...>(node->ctor, std::make_index_sequence<sizeof...(Args)>{});
-    }
-
     /**
      * @brief Returns a range to visit registered top-level meta data.
      * @return An iterable range to visit registered top-level meta data.
@@ -1515,11 +1397,6 @@ bool meta_any::set(const id_type id, Type &&value) {
 }
 
 
-[[nodiscard]] inline meta_type meta_ctor::arg(const size_type index) const ENTT_NOEXCEPT {
-    return index < arity() ? node->arg(index) : meta_type{};
-}
-
-
 [[nodiscard]] inline meta_type meta_data::type() const ENTT_NOEXCEPT {
     return node->type;
 }

+ 0 - 1
src/entt/meta/node.hpp

@@ -74,7 +74,6 @@ struct meta_conv_node {
 struct meta_ctor_node {
     using size_type = std::size_t;
     meta_ctor_node * next;
-    meta_prop_node * prop;
     const size_type arity;
     meta_type(* const arg)(const size_type) ENTT_NOEXCEPT;
     meta_any(* const invoke)(meta_any * const);

+ 16 - 108
test/entt/meta/meta_ctor.cpp

@@ -56,8 +56,8 @@ struct MetaCtor: ::testing::Test {
             .type("clazz"_hs)
             .ctor<&entt::registry::emplace_or_replace<clazz_t, const int &, const char &>, entt::as_ref_t>()
             .ctor<const base_t &, int>()
-            .ctor<const int &, char>().prop(3, false)
-            .ctor<entt::overload<clazz_t(int)>(clazz_t::factory)>().prop('c', 42)
+            .ctor<const int &, char>()
+            .ctor<entt::overload<clazz_t(int)>(clazz_t::factory)>()
             .ctor<entt::overload<clazz_t(base_t, int, int)>(clazz_t::factory)>()
             .conv<int>();
     }
@@ -68,74 +68,23 @@ struct MetaCtor: ::testing::Test {
 };
 
 TEST_F(MetaCtor, Functionalities) {
-    using namespace entt::literals;
+    auto any = entt::resolve<clazz_t>().construct(42, 'c');
 
-    auto ctor = entt::resolve<clazz_t>().ctor<const int &, char>();
-
-    ASSERT_TRUE(ctor);
-    ASSERT_EQ(ctor.arity(), 2u);
-    ASSERT_EQ(ctor.arg(0u), entt::resolve<int>());
-    ASSERT_EQ(ctor.arg(1u), entt::resolve<char>());
-    ASSERT_FALSE(ctor.arg(2u));
-
-    auto any = ctor.invoke(42, 'c');
-    auto empty = ctor.invoke();
-
-    ASSERT_FALSE(empty);
     ASSERT_TRUE(any);
     ASSERT_EQ(any.cast<clazz_t>().i, 42);
     ASSERT_EQ(any.cast<clazz_t>().c, 'c');
-
-    for(auto curr: ctor.prop()) {
-        ASSERT_EQ(curr.key(), 3);
-        ASSERT_FALSE(curr.value().template cast<bool>());
-    }
-
-    ASSERT_FALSE(ctor.prop(2));
-    ASSERT_FALSE(ctor.prop('c'));
-
-    auto prop = ctor.prop(3);
-
-    ASSERT_TRUE(prop);
-    ASSERT_EQ(prop.key(), 3);
-    ASSERT_FALSE(prop.value().template cast<bool>());
 }
 
 TEST_F(MetaCtor, Func) {
-    using namespace entt::literals;
+    auto any = entt::resolve<clazz_t>().construct(42);
 
-    auto ctor = entt::resolve<clazz_t>().ctor<int>();
-
-    ASSERT_TRUE(ctor);
-    ASSERT_EQ(ctor.arity(), 1u);
-    ASSERT_EQ(ctor.arg(0u), entt::resolve<int>());
-    ASSERT_FALSE(ctor.arg(1u));
-
-    auto any = ctor.invoke(42);
-    auto empty = ctor.invoke(3, 'c');
-
-    ASSERT_FALSE(empty);
     ASSERT_TRUE(any);
     ASSERT_EQ(any.cast<clazz_t>().i, 42);
     ASSERT_EQ(any.cast<clazz_t>().c, 'c');
-
-    for(auto curr: ctor.prop()) {
-        ASSERT_EQ(curr.key(), 'c');
-        ASSERT_EQ(curr.value(), 42);
-    }
-
-    ASSERT_FALSE(ctor.prop('d'));
-    ASSERT_FALSE(ctor.prop(3));
-
-    auto prop = ctor.prop('c');
-
-    ASSERT_TRUE(prop);
-    ASSERT_EQ(prop.key(), 'c');
-    ASSERT_EQ(prop.value(), 42);
 }
 
 TEST_F(MetaCtor, MetaAnyArgs) {
-    auto any = entt::resolve<clazz_t>().ctor<int, char>().invoke(entt::meta_any{42}, entt::meta_any{'c'});
+    auto any = entt::resolve<clazz_t>().construct(entt::meta_any{42}, entt::meta_any{'c'});
 
     ASSERT_TRUE(any);
     ASSERT_EQ(any.cast<clazz_t>().i, 42);
@@ -143,12 +92,11 @@ TEST_F(MetaCtor, MetaAnyArgs) {
 }
 
 TEST_F(MetaCtor, InvalidArgs) {
-    auto ctor = entt::resolve<clazz_t>().ctor<int, char>();
-    ASSERT_FALSE(ctor.invoke(entt::meta_any{}, derived_t{}));
+    ASSERT_FALSE(entt::resolve<clazz_t>().construct(entt::meta_any{}, derived_t{}));
 }
 
 TEST_F(MetaCtor, CastAndConvert) {
-    auto any = entt::resolve<clazz_t>().ctor<const base_t &, int>().invoke(derived_t{}, clazz_t{42, 'd'});
+    auto any = entt::resolve<clazz_t>().construct(derived_t{}, clazz_t{42, 'd'});
 
     ASSERT_TRUE(any);
     ASSERT_EQ(any.cast<clazz_t>().i, 42);
@@ -156,7 +104,7 @@ TEST_F(MetaCtor, CastAndConvert) {
 }
 
 TEST_F(MetaCtor, ArithmeticConversion) {
-    auto any = entt::resolve<clazz_t>().ctor<int, char>().invoke(true, 4.2);
+    auto any = entt::resolve<clazz_t>().construct(true, 4.2);
 
     ASSERT_TRUE(any);
     ASSERT_EQ(any.cast<clazz_t>().i, 1);
@@ -167,7 +115,7 @@ TEST_F(MetaCtor, ConstNonConstRefArgs) {
     int ivalue = 42;
     const char cvalue = 'c';
 
-    auto any = entt::resolve<clazz_t>().ctor<int, char>().invoke(entt::forward_as_meta(ivalue), entt::forward_as_meta(cvalue));
+    auto any = entt::resolve<clazz_t>().construct(entt::forward_as_meta(ivalue), entt::forward_as_meta(cvalue));
 
     ASSERT_TRUE(any);
     ASSERT_EQ(any.cast<clazz_t>().i, 42);
@@ -175,20 +123,15 @@ TEST_F(MetaCtor, ConstNonConstRefArgs) {
 }
 
 TEST_F(MetaCtor, FuncMetaAnyArgs) {
-    auto any = entt::resolve<clazz_t>().ctor<int>().invoke(entt::meta_any{42});
+    auto any = entt::resolve<clazz_t>().construct(entt::meta_any{42});
 
     ASSERT_TRUE(any);
     ASSERT_EQ(any.cast<clazz_t>().i, 42);
     ASSERT_EQ(any.cast<clazz_t>().c, 'c');
 }
 
-TEST_F(MetaCtor, FuncInvalidArgs) {
-    auto ctor = entt::resolve<clazz_t>().ctor<int>();
-    ASSERT_FALSE(ctor.invoke(derived_t{}));
-}
-
 TEST_F(MetaCtor, FuncCastAndConvert) {
-    auto any = entt::resolve<clazz_t>().ctor<base_t, int, int>().invoke(derived_t{}, 3., clazz_t{3, 'd'});
+    auto any = entt::resolve<clazz_t>().construct(derived_t{}, 3., clazz_t{3, 'd'});
 
     ASSERT_TRUE(any);
     ASSERT_EQ(any.cast<clazz_t>().i, 9);
@@ -196,7 +139,7 @@ TEST_F(MetaCtor, FuncCastAndConvert) {
 }
 
 TEST_F(MetaCtor, FuncArithmeticConversion) {
-    auto any = entt::resolve<clazz_t>().ctor<int>().invoke(4.2);
+    auto any = entt::resolve<clazz_t>().construct(4.2);
 
     ASSERT_TRUE(any);
     ASSERT_EQ(any.cast<clazz_t>().i, 4);
@@ -205,10 +148,8 @@ TEST_F(MetaCtor, FuncArithmeticConversion) {
 
 TEST_F(MetaCtor, FuncConstNonConstRefArgs) {
     int ivalue = 42;
-    auto ctor = entt::resolve<clazz_t>().ctor<int>();
-
-    auto any = ctor.invoke(entt::forward_as_meta(ivalue));
-    auto other = ctor.invoke(entt::make_meta<const int &>(ivalue));
+    auto any = entt::resolve<clazz_t>().construct(entt::forward_as_meta(ivalue));
+    auto other = entt::resolve<clazz_t>().construct(entt::make_meta<const int &>(ivalue));
 
     ASSERT_TRUE(any);
     ASSERT_TRUE(other);
@@ -217,24 +158,12 @@ TEST_F(MetaCtor, FuncConstNonConstRefArgs) {
 }
 
 TEST_F(MetaCtor, ExternalMemberFunction) {
-    using namespace entt::literals;
-
-    auto ctor = entt::resolve<clazz_t>().ctor<entt::registry &, entt::entity, const int &, const char &>();
-
-    ASSERT_TRUE(ctor);
-    ASSERT_EQ(ctor.arity(), 4u);
-    ASSERT_EQ(ctor.arg(0u), entt::resolve<entt::registry>());
-    ASSERT_EQ(ctor.arg(1u), entt::resolve<entt::entity>());
-    ASSERT_EQ(ctor.arg(2u), entt::resolve<int>());
-    ASSERT_EQ(ctor.arg(3u), entt::resolve<char>());
-    ASSERT_FALSE(ctor.arg(4u));
-
     entt::registry registry;
     const auto entity = registry.create();
 
     ASSERT_FALSE(registry.all_of<clazz_t>(entity));
 
-    const auto any = ctor.invoke(entt::forward_as_meta(registry), entity, 3, 'c');
+    const auto any = entt::resolve<clazz_t>().construct(entt::forward_as_meta(registry), entity, 3, 'c');
 
     ASSERT_TRUE(any);
     ASSERT_TRUE(registry.all_of<clazz_t>(entity));
@@ -242,30 +171,9 @@ TEST_F(MetaCtor, ExternalMemberFunction) {
     ASSERT_EQ(registry.get<clazz_t>(entity).c, 'c');
 }
 
-TEST_F(MetaCtor, ImplicitlyGeneratedDefaultConstructor) {
-    auto type = entt::resolve<int>();
-
-    // implicitly generated default constructor is not listed among registered
-    ASSERT_EQ(type.ctor().begin(), type.ctor().end());
-    ASSERT_FALSE(type.ctor<>());
-
-    auto any = type.construct();
-
-    ASSERT_TRUE(any);
-    ASSERT_EQ(any.type(), entt::resolve<int>());
-    ASSERT_EQ(any.cast<int>(), 0);
-}
-
 TEST_F(MetaCtor, OverrideImplicitlyGeneratedDefaultConstructor) {
     auto type = entt::resolve<double>();
-
-    // implicitly generated default constructor is not listed among registered
-    ASSERT_EQ(++type.ctor().begin(), type.ctor().end());
-    ASSERT_TRUE(type.ctor<>());
-    ASSERT_EQ(type.ctor<>().arity(), 0u);
-    ASSERT_EQ(type.ctor<>().arg(0), entt::meta_type{});
-
-    auto any = type.ctor<>().invoke();
+    auto any = type.construct();
 
     ASSERT_TRUE(any);
     ASSERT_EQ(any.type(), entt::resolve<double>());

+ 6 - 26
test/entt/meta/meta_type.cpp

@@ -271,17 +271,12 @@ TEST_F(MetaType, Base) {
 }
 
 TEST_F(MetaType, Ctor) {
+    derived_t derived;
+    base_t &base = derived;
     auto type = entt::resolve<clazz_t>();
-    int counter{};
 
-    for([[maybe_unused]] auto curr: type.ctor()) {
-        ++counter;
-    }
-
-    ASSERT_EQ(counter, 1);
-    ASSERT_FALSE((type.ctor<>()));
-    ASSERT_TRUE((type.ctor<const base_t &, int>()));
-    ASSERT_TRUE((type.ctor<const derived_t &, double>()));
+    ASSERT_TRUE((type.construct(entt::forward_as_meta(derived), 42)));
+    ASSERT_TRUE((type.construct(entt::forward_as_meta(base), 42)));
 
     // use the implicitly generated default constructor
     auto any = type.construct();
@@ -382,21 +377,6 @@ TEST_F(MetaType, OverloadedFunc) {
     ASSERT_FALSE(ambiguous);
 }
 
-TEST_F(MetaType, SetGet) {
-    using namespace entt::literals;
-
-    auto type = entt::resolve<clazz_t>();
-    clazz_t instance{};
-
-    ASSERT_TRUE(type.set("value"_hs, instance, 42));
-    ASSERT_FALSE(type.set("eulav"_hs, instance, 3));
-    ASSERT_EQ(instance.value, 42);
-
-    ASSERT_FALSE(type.get("eulav"_hs, instance));
-    ASSERT_TRUE(type.get("value"_hs, instance));
-    ASSERT_EQ(type.get("value"_hs, instance).cast<int>(), 42);
-}
-
 TEST_F(MetaType, Construct) {
     auto any = entt::resolve<clazz_t>().construct(base_t{}, 42);
 
@@ -447,7 +427,7 @@ TEST_F(MetaType, Reset) {
     ASSERT_EQ(entt::resolve<clazz_t>().id(), "clazz"_hs);
     ASSERT_TRUE(entt::resolve<clazz_t>().prop(property_t::value));
     ASSERT_TRUE(entt::resolve<clazz_t>().data("value"_hs));
-    ASSERT_TRUE((entt::resolve<clazz_t>().ctor<const base_t &, clazz_t>()));
+    ASSERT_TRUE((entt::resolve<clazz_t>().construct(derived_t{}, clazz_t{})));
     // implicitly generated default constructor
     ASSERT_TRUE(entt::resolve<clazz_t>().construct());
 
@@ -457,7 +437,7 @@ TEST_F(MetaType, Reset) {
     ASSERT_NE(entt::resolve<clazz_t>().id(), "clazz"_hs);
     ASSERT_FALSE(entt::resolve<clazz_t>().prop(property_t::value));
     ASSERT_FALSE(entt::resolve<clazz_t>().data("value"_hs));
-    ASSERT_FALSE((entt::resolve<clazz_t>().ctor<const base_t &, clazz_t>()));
+    ASSERT_FALSE((entt::resolve<clazz_t>().construct(derived_t{}, clazz_t{})));
     // implicitly generated default constructor is not cleared
     ASSERT_TRUE(entt::resolve<clazz_t>().construct());
 

+ 1 - 1
test/lib/meta/main.cpp

@@ -25,7 +25,7 @@ TEST(Lib, Meta) {
     ASSERT_EQ(entt::resolve<velocity>(), entt::resolve("velocity"_hs));
 
     auto pos = entt::resolve("position"_hs).construct(42., 3.);
-    auto vel = entt::resolve("velocity"_hs).ctor<>().invoke();
+    auto vel = entt::resolve("velocity"_hs).construct();
 
     ASSERT_TRUE(pos && vel);
 

+ 1 - 1
test/lib/meta_plugin/main.cpp

@@ -26,7 +26,7 @@ TEST(Lib, Meta) {
     ASSERT_TRUE(entt::resolve("velocity"_hs));
 
     auto pos = entt::resolve("position"_hs).construct(42., 3.);
-    auto vel = entt::resolve("velocity"_hs).ctor<>().invoke();
+    auto vel = entt::resolve("velocity"_hs).construct();
 
     ASSERT_TRUE(pos && vel);
 

+ 1 - 1
test/lib/meta_plugin_std/main.cpp

@@ -26,7 +26,7 @@ TEST(Lib, Meta) {
     ASSERT_TRUE(entt::resolve("velocity"_hs));
 
     auto pos = entt::resolve("position"_hs).construct(42., 3.);
-    auto vel = entt::resolve("velocity"_hs).ctor<>().invoke();
+    auto vel = entt::resolve("velocity"_hs).construct();
 
     ASSERT_TRUE(pos && vel);