2020
2121#include " type_meta.hpp"
2222
23- #include " FunctorId.hpp"
24-
2523namespace rtl ::detail
2624{
2725 template <class _derivedType >
@@ -33,9 +31,9 @@ namespace rtl::detail
3331 this is stored in _derivedType's (MethodContainer<detail::member::NonConst, _signature...>) vector holding lambda's.
3432 */ return [](const FunctorId& pFunctorId, const RObject& pTargetObj, _signature&&...params )-> Return
3533 {
36- auto fptr = pFunctorId. get_lambda_method <_recordType, _signature...>()
37- -> template get_hopper < void >()
38- .f_ptr ();
34+ using method_t = dispatch::method_ptr <_recordType, void , _signature...>;
35+
36+ auto fptr = static_cast < const method_t &>(pFunctorId. get_functor ()) .f_ptr ();
3937
4038 if (!pTargetObj.isConstCastSafe ()) [[unlikely]] {
4139 return { error::IllegalConstCast, RObject{} };
@@ -57,9 +55,9 @@ namespace rtl::detail
5755 this is stored in _derivedType's (MethodContainer<detail::member::NonConst, _signature...>) vector holding lambda's.
5856 */ return [](const FunctorId& pFunctorId, const RObject& pTargetObj, _signature&&...params )-> Return
5957 {
60- auto fptr = pFunctorId. get_lambda_method <_recordType, _signature...>()
61- -> template get_hopper <_returnType>()
62- .f_ptr ();
58+ using method_t = dispatch::method_ptr <_recordType, _returnType, _signature...>;
59+
60+ auto fptr = static_cast < const method_t &>(pFunctorId. get_functor ()) .f_ptr ();
6361
6462 if (!pTargetObj.isConstCastSafe ()) [[unlikely]] {
6563 return { error::IllegalConstCast, RObject{} };
@@ -102,9 +100,9 @@ namespace rtl::detail
102100 this is stored in _derivedType's (MethodContainer<detail::member::Const, _signature...>) vector holding lambda's.
103101 */ return [](const FunctorId& pFunctorId, const RObject& pTargetObj, _signature&&...params )-> Return
104102 {
105- auto fptr = pFunctorId. get_lambda_method <const _recordType, _signature...>()
106- -> template get_hopper < void >()
107- .f_ptr ();
103+ using method_t = dispatch::method_ptr <const _recordType, void , _signature...>;
104+
105+ auto fptr = static_cast < const method_t &>(pFunctorId. get_functor ()) .f_ptr ();
108106
109107 const _recordType& target = pTargetObj.view <_recordType>()->get ();
110108 (target.*fptr)(std::forward<_signature>(params)...);
@@ -122,9 +120,9 @@ namespace rtl::detail
122120 this is stored in _derivedType's (MethodContainer<detail::member::Const, _signature...>) vector holding lambda's.
123121 */ return [](const FunctorId& pFunctorId, const RObject& pTargetObj, _signature&&...params )-> Return
124122 {
125- auto fptr = pFunctorId. get_lambda_method <const _recordType, _signature...>()
126- -> template get_hopper <_returnType>()
127- .f_ptr ();
123+ using method_t = dispatch::method_ptr <const _recordType, _returnType, _signature...>;
124+
125+ auto fptr = static_cast < const method_t &>(pFunctorId. get_functor ()) .f_ptr ();
128126
129127 constexpr bool isConstCastSafe = (!traits::is_const_v<_returnType>);
130128 // 'target' is const and 'pFunctor' is const-member-function.
@@ -197,7 +195,7 @@ namespace rtl::detail
197195 TypeId<_recordType>::get (),
198196 _derivedType::getContainerId (),
199197 _derivedType::template getSignatureStr<_recordType, _returnType>(),
200- &(typeMeta.get_lambda ())
198+ &(typeMeta.get_functor ())
201199 }
202200 };
203201 }
@@ -247,7 +245,7 @@ namespace rtl::detail
247245 TypeId<_recordType>::get (),
248246 _derivedType::getContainerId (),
249247 _derivedType::template getSignatureStr<_recordType, _returnType>(),
250- &(typeMeta.get_lambda ())
248+ &(typeMeta.get_functor ())
251249 }
252250 };
253251 }
0 commit comments