@@ -64,15 +64,18 @@ namespace rtl
6464 */ using _rawRetType = traits::raw_t <_returnType>;
6565 const _rawRetType& retObj = (target.*pFunctor)(std::forward<_signature>(params)...);
6666 return { error::None,
67- RObjectBuilder<const _rawRetType*>::build<rtl::alloc::Stack>(&retObj, isConstCastSafe)
67+ RObjectBuilder<const _rawRetType*>::template
68+ build<rtl::alloc::Stack>(&retObj, isConstCastSafe)
6869 };
6970 }
7071 else {
7172
72- _returnType&& retObj = std::move ((target.*pFunctor)(std::forward<_signature>(params)...));
73+ auto && retObj = (target.*pFunctor)(std::forward<_signature>(params)...);
74+ using T = std::remove_cvref_t <decltype (retObj)>;
75+
7376 return { error::None,
74- RObjectBuilder<_returnType >::build<alloc::Stack>(
75- std::forward<_returnType >(retObj), isConstCastSafe)
77+ RObjectBuilder<const T >::template
78+ build<rtl::alloc::Stack>( std::forward<decltype (retObj) >(retObj), isConstCastSafe)
7679 };
7780 }
7881 };
@@ -114,14 +117,18 @@ namespace rtl
114117 */ using _rawRetType = traits::raw_t <_returnType>;
115118 const _rawRetType& retObj = (target.*pFunctor)(std::forward<_signature>(params)...);
116119 return { error::None,
117- RObjectBuilder<const _rawRetType*>::build<rtl::alloc::Stack>(&retObj, isConstCastSafe)
120+ RObjectBuilder<const _rawRetType*>::template
121+ build<rtl::alloc::Stack>(&retObj, isConstCastSafe)
118122 };
119123 }
120124 else {
121- _returnType&& retObj = std::move ((target.*pFunctor)(std::forward<_signature>(params)...));
125+
126+ auto && retObj = (target.*pFunctor)(std::forward<_signature>(params)...);
127+ using T = std::remove_cvref_t <decltype (retObj)>;
128+
122129 return { error::None,
123- RObjectBuilder<_returnType >::build<alloc::Stack>(
124- std::forward<_returnType >(retObj), isConstCastSafe)
130+ RObjectBuilder<const T >::template
131+ build<rtl::alloc::Stack>( std::forward<decltype (retObj) >(retObj), isConstCastSafe)
125132 };
126133 }
127134 };
0 commit comments