|
|
@@ -205,7 +205,13 @@ 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(internal::meta_base_node{type_id<Base>().hash(), &internal::resolve<Base>, op});
|
|
|
+
|
|
|
+ base_type::insert_or_assign(
|
|
|
+ internal::meta_base_node{
|
|
|
+ type_id<Base>().hash(),
|
|
|
+ &internal::resolve<Base>,
|
|
|
+ op});
|
|
|
+
|
|
|
return *this;
|
|
|
}
|
|
|
|
|
|
@@ -225,7 +231,12 @@ public:
|
|
|
auto conv() noexcept {
|
|
|
using conv_type = std::remove_cvref_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(internal::meta_conv_node{type_id<conv_type>().hash(), op});
|
|
|
+
|
|
|
+ base_type::insert_or_assign(
|
|
|
+ internal::meta_conv_node{
|
|
|
+ type_id<conv_type>().hash(),
|
|
|
+ op});
|
|
|
+
|
|
|
return *this;
|
|
|
}
|
|
|
|
|
|
@@ -242,7 +253,12 @@ public:
|
|
|
meta_factory conv() noexcept {
|
|
|
using conv_type = std::remove_cvref_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(internal::meta_conv_node{type_id<conv_type>().hash(), op});
|
|
|
+
|
|
|
+ base_type::insert_or_assign(
|
|
|
+ internal::meta_conv_node{
|
|
|
+ type_id<conv_type>().hash(),
|
|
|
+ op});
|
|
|
+
|
|
|
return *this;
|
|
|
}
|
|
|
|
|
|
@@ -264,7 +280,14 @@ 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_cvref_t<typename descriptor::return_type>, Type>, "The function doesn't return an object of the required type");
|
|
|
- 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>});
|
|
|
+
|
|
|
+ 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;
|
|
|
}
|
|
|
|
|
|
@@ -283,7 +306,13 @@ 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(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...>});
|
|
|
+
|
|
|
+ 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;
|