Skip to content

Commit

Permalink
[unreal]解决静态绑定返回对象引用的函数报错,fix #1664
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Feb 28, 2024
1 parent 56b98be commit 8e7c330
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions unreal/Puerts/Source/JsEnv/Public/StaticCall.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,10 @@ struct FuncCallHelper<API, std::pair<Ret, std::tuple<Args...>>, CheckArguments,
(is_objecttype<typename std::decay<T>::type>::value ||
is_uetype<typename std::decay<T>::type>::value)>::type>
{
static typename API::ValueType Convert(typename API::ContextType context, typename std::decay<T>::type ret)
static typename API::ValueType Convert(typename API::ContextType context, const typename std::decay<T>::type& ret)
{
return DecayTypeConverter<typename std::decay<T>::type*>::toScript(context, &ret);
return DecayTypeConverter<typename std::decay<T>::type*>::toScript(
context, &(const_cast<typename std::decay<T>::type&>(ret)));
}
};

Expand Down

0 comments on commit 8e7c330

Please sign in to comment.