Skip to content

Commit

Permalink
Workaround build error(C3546) in vs2022(v17.11.2) (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-way authored Sep 20, 2024
1 parent df62328 commit dc54e7f
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/Native.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,7 @@ InternalStoreHelper::set(T&& value) const {
}

template <typename... T>
inline internal::type_t<Local<Value>,
std::void_t<decltype(&internal::TypeConverter<T>::toScript)>...>
inline internal::type_t<Local<Value>, decltype(&internal::TypeConverter<T>::toScript)...>
Local<Function>::call(const Local<Value>& thiz, T&&... args) const {
return call(thiz, {internal::TypeConverter<T>::toScript(std::forward<T>(args))...});
}
Expand All @@ -660,8 +659,7 @@ std::function<FuncType> Local<Function>::wrapper(const Local<Value>& thiz) const
}

template <typename... T>
inline internal::type_t<Local<Object>,
std::void_t<decltype(&internal::TypeConverter<T>::toScript)>...>
inline internal::type_t<Local<Object>, decltype(&internal::TypeConverter<T>::toScript)...>
Object::newObject(const Local<Value>& type, T&&... args) {
return newObject(type, {internal::TypeConverter<T>::toScript(std::forward<T>(args))...});
}
Expand All @@ -685,9 +683,8 @@ inline Local<Array> Array::newArray(const std::initializer_list<Local<Value>>& e
}

template <typename... T>
inline internal::type_t<Local<Array>,
std::void_t<decltype(&internal::TypeConverter<T>::toScript)>...>
Array::of(T&&... args) {
inline internal::type_t<Local<Array>, decltype(&internal::TypeConverter<T>::toScript)...> Array::of(
T&&... args) {
return newArray({internal::TypeConverter<T>::toScript(std::forward<T>(args))...});
}

Expand Down Expand Up @@ -736,8 +733,7 @@ ScriptEngine::set(StringLike&& keyStringLike, T&& value) {
}

template <typename D, typename... T>
inline internal::type_t<Local<Object>,
std::void_t<decltype(&internal::TypeConverter<T>::toScript)>...>
inline internal::type_t<Local<Object>, decltype(&internal::TypeConverter<T>::toScript)...>
ScriptEngine::newNativeClass(T&&... args) {
return newNativeClass<D>({internal::TypeConverter<T>::toScript(std::forward<T>(args))...});
}
Expand Down

0 comments on commit dc54e7f

Please sign in to comment.