|
|
@@ -55,16 +55,16 @@ protected:
|
|
|
}
|
|
|
|
|
|
template<typename Type>
|
|
|
- void insert_or_assign(const id_type id, Type node) {
|
|
|
+ void insert_or_assign(Type node) {
|
|
|
reset_bucket(parent);
|
|
|
|
|
|
if constexpr(std::is_same_v<Type, meta_base_node>) {
|
|
|
- details->base.insert_or_assign(id, node);
|
|
|
+ details->base.insert_or_assign(node.id, node);
|
|
|
} else if constexpr(std::is_same_v<Type, meta_conv_node>) {
|
|
|
- details->conv.insert_or_assign(id, node);
|
|
|
+ details->conv.insert_or_assign(node.type, node);
|
|
|
} else {
|
|
|
static_assert(std::is_same_v<Type, meta_ctor_node>, "Unexpected type");
|
|
|
- details->ctor.insert_or_assign(id, node);
|
|
|
+ details->ctor.insert_or_assign(node.id, node);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -221,7 +221,7 @@ public:
|
|
|
meta_factory base() noexcept {
|
|
|
static_assert(!std::is_same_v<Type, Base> && std::is_base_of_v<Base, Type>, "Invalid base type");
|
|
|
auto *const op = +[](const void *instance) noexcept { return static_cast<const void *>(static_cast<const Base *>(static_cast<const Type *>(instance))); };
|
|
|
- base_type::insert_or_assign(type_id<Base>().hash(), internal::meta_base_node{&internal::resolve<Base>, op});
|
|
|
+ base_type::insert_or_assign(internal::meta_base_node{type_id<Base>().hash(), &internal::resolve<Base>, op});
|
|
|
return *this;
|
|
|
}
|
|
|
|
|
|
@@ -241,7 +241,7 @@ public:
|
|
|
auto conv() noexcept {
|
|
|
using conv_type = std::remove_cv_t<std::remove_reference_t<std::invoke_result_t<decltype(Candidate), Type &>>>;
|
|
|
auto *const op = +[](const meta_ctx &area, const void *instance) { return forward_as_meta(area, std::invoke(Candidate, *static_cast<const Type *>(instance))); };
|
|
|
- base_type::insert_or_assign(type_id<conv_type>().hash(), internal::meta_conv_node{op});
|
|
|
+ base_type::insert_or_assign(internal::meta_conv_node{type_id<conv_type>().hash(), op});
|
|
|
return *this;
|
|
|
}
|
|
|
|
|
|
@@ -258,7 +258,7 @@ public:
|
|
|
meta_factory conv() noexcept {
|
|
|
using conv_type = std::remove_cv_t<std::remove_reference_t<To>>;
|
|
|
auto *const op = +[](const meta_ctx &area, const void *instance) { return forward_as_meta(area, static_cast<To>(*static_cast<const Type *>(instance))); };
|
|
|
- base_type::insert_or_assign(type_id<conv_type>().hash(), internal::meta_conv_node{op});
|
|
|
+ base_type::insert_or_assign(internal::meta_conv_node{type_id<conv_type>().hash(), op});
|
|
|
return *this;
|
|
|
}
|
|
|
|
|
|
@@ -280,7 +280,7 @@ public:
|
|
|
using descriptor = meta_function_helper_t<Type, decltype(Candidate)>;
|
|
|
static_assert(Policy::template value<typename descriptor::return_type>, "Invalid return type for the given policy");
|
|
|
static_assert(std::is_same_v<std::remove_cv_t<std::remove_reference_t<typename descriptor::return_type>>, Type>, "The function doesn't return an object of the required type");
|
|
|
- base_type::insert_or_assign(type_id<typename descriptor::args_type>().hash(), internal::meta_ctor_node{descriptor::args_type::size, &meta_arg<typename descriptor::args_type>, &meta_construct<Type, Candidate, Policy>});
|
|
|
+ base_type::insert_or_assign(internal::meta_ctor_node{type_id<typename descriptor::args_type>().hash(), descriptor::args_type::size, &meta_arg<typename descriptor::args_type>, &meta_construct<Type, Candidate, Policy>});
|
|
|
return *this;
|
|
|
}
|
|
|
|
|
|
@@ -299,7 +299,7 @@ public:
|
|
|
// default constructor is already implicitly generated, no need for redundancy
|
|
|
if constexpr(sizeof...(Args) != 0u) {
|
|
|
using descriptor = meta_function_helper_t<Type, Type (*)(Args...)>;
|
|
|
- base_type::insert_or_assign(type_id<typename descriptor::args_type>().hash(), internal::meta_ctor_node{descriptor::args_type::size, &meta_arg<typename descriptor::args_type>, &meta_construct<Type, Args...>});
|
|
|
+ base_type::insert_or_assign(internal::meta_ctor_node{type_id<typename descriptor::args_type>().hash(), descriptor::args_type::size, &meta_arg<typename descriptor::args_type>, &meta_construct<Type, Args...>});
|
|
|
}
|
|
|
|
|
|
return *this;
|