@@ -29,12 +29,7 @@ namespace rtl
2929 {
3030 return [](const FunctorId& pFunctorId, _signature&&... params) -> Return
3131 {
32- using function_t = dispatch::function_ptr<void , _signature...>;
33-
34- auto fptr = static_cast <const function_t &>(pFunctorId.get_functor ()).f_ptr ();
35-
36- fptr (std::forward<_signature>(params)...);
37- return { error::None, RObject{} };
32+ return { error::InvalidCaller, RObject{} };
3833 };
3934 }
4035
@@ -48,32 +43,7 @@ namespace rtl
4843 this is stored in _derivedType's (FunctorContainer) vector holding lambda's.
4944 */ return [](const FunctorId& pFunctorId, _signature&&...params )-> Return
5045 {
51- using function_t = dispatch::function_ptr<_returnType, _signature...>;
52-
53- auto fptr = static_cast <const function_t &>(pFunctorId.get_functor ()).f_ptr ();
54-
55- constexpr bool isConstCastSafe = (!traits::is_const_v<_returnType>);
56-
57- if constexpr (std::is_reference_v<_returnType>) {
58- /* if the function returns reference, this block will be retained by compiler.
59- Note: reference to temporary or dangling is not checked here.
60- */ using _rawRetType = traits::raw_t <_returnType>;
61- const _rawRetType& retObj = fptr (std::forward<_signature>(params)...);
62- return { error::None,
63- RObjectBuilder<const _rawRetType*>::template
64- build<rtl::alloc::Stack>(&retObj, isConstCastSafe)
65- };
66- }
67- else {
68- // if the function returns anything (not refrence), this block will be retained by compiler.
69- auto && retObj = fptr (std::forward<_signature>(params)...);
70- using T = std::remove_cvref_t <decltype (retObj)>;
71-
72- return { error::None,
73- RObjectBuilder<const T>::template
74- build<rtl::alloc::Stack>(std::forward<decltype (retObj)>(retObj), isConstCastSafe)
75- };
76- }
46+ return { error::InvalidCaller, RObject{} };
7747 };
7848 }
7949
0 commit comments