Skip to content

Commit

Permalink
[unreal]解决静态绑定含const UObject*的函数的报错,fix #1665
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Feb 28, 2024
1 parent 8e7c330 commit 38657c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion unreal/Puerts/Source/JsEnv/Public/UEDataBinding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ struct Converter<T*, typename std::enable_if<std::is_convertible<T*, const UObje
{
static v8::Local<v8::Value> toScript(v8::Local<v8::Context> context, T* value)
{
return DataTransfer::FindOrAddObject<T>(context->GetIsolate(), context, value);
using TypeWithoutConst = typename std::remove_const<T>::type;
return DataTransfer::FindOrAddObject<TypeWithoutConst>(context->GetIsolate(), context, (TypeWithoutConst*) (value));
}

static T* toCpp(v8::Local<v8::Context> context, const v8::Local<v8::Value>& value)
Expand Down

0 comments on commit 38657c7

Please sign in to comment.