|
|
@@ -83,7 +83,7 @@ template<typename Type, auto Data>
|
|
|
using helper_type = meta_function_helper_t<decltype(Data)>;
|
|
|
using data_type = std::tuple_element_t<!std::is_member_function_pointer_v<decltype(Data)>, typename helper_type::args_type>;
|
|
|
|
|
|
- if(auto * const clazz = (*instance).try_cast<Type>(); clazz) {
|
|
|
+ if(auto * const clazz = instance.ref().try_cast<Type>(); clazz) {
|
|
|
if(auto * const direct = value.try_cast<data_type>(); direct || value.convert<data_type>()) {
|
|
|
std::invoke(Data, *clazz, direct ? *direct : value.cast<data_type>());
|
|
|
accepted = true;
|
|
|
@@ -93,7 +93,7 @@ template<typename Type, auto Data>
|
|
|
using data_type = std::remove_cv_t<std::remove_reference_t<decltype(std::declval<Type>().*Data)>>;
|
|
|
|
|
|
if constexpr(!std::is_array_v<data_type>) {
|
|
|
- if(auto * const clazz = (*instance).try_cast<Type>(); clazz) {
|
|
|
+ if(auto * const clazz = instance.ref().try_cast<Type>(); clazz) {
|
|
|
if(auto * const direct = value.try_cast<data_type>(); direct || value.convert<data_type>()) {
|
|
|
std::invoke(Data, clazz) = (direct ? *direct : value.cast<data_type>());
|
|
|
accepted = true;
|
|
|
@@ -129,13 +129,13 @@ template<typename Type, auto Data, typename Policy>
|
|
|
};
|
|
|
|
|
|
if constexpr(std::is_function_v<std::remove_reference_t<std::remove_pointer_t<decltype(Data)>>> || std::is_member_function_pointer_v<decltype(Data)>) {
|
|
|
- auto * const clazz = (*instance).try_cast<Type>();
|
|
|
+ auto * const clazz = instance.ref().try_cast<Type>();
|
|
|
return clazz ? dispatch(std::invoke(Data, *clazz)) : meta_any{};
|
|
|
} else if constexpr(std::is_member_object_pointer_v<decltype(Data)>) {
|
|
|
if constexpr(std::is_array_v<std::remove_cv_t<std::remove_reference_t<decltype(std::declval<Type>().*Data)>>>) {
|
|
|
return meta_any{};
|
|
|
} else {
|
|
|
- auto * const clazz = (*instance).try_cast<Type>();
|
|
|
+ auto * const clazz = instance.ref().try_cast<Type>();
|
|
|
return clazz ? dispatch(std::invoke(Data, clazz)) : meta_any{};
|
|
|
}
|
|
|
} else if constexpr(std::is_pointer_v<std::decay_t<decltype(Data)>>) {
|
|
|
@@ -179,7 +179,7 @@ template<typename Type, auto Candidate, typename Policy, std::size_t... Indexes>
|
|
|
if constexpr(std::is_function_v<std::remove_reference_t<std::remove_pointer_t<decltype(Candidate)>>>) {
|
|
|
return (std::get<Indexes>(direct) && ...) ? dispatch(std::get<Indexes>(direct)...) : meta_any{};
|
|
|
} else {
|
|
|
- auto * const clazz = (*instance).try_cast<Type>();
|
|
|
+ auto * const clazz = instance.ref().try_cast<Type>();
|
|
|
return (clazz && (std::get<Indexes>(direct) && ...)) ? dispatch(clazz, std::get<Indexes>(direct)...) : meta_any{};
|
|
|
}
|
|
|
}
|