diff --git a/src/Native.hpp b/src/Native.hpp index 9f46b3c7..3991e5ff 100644 --- a/src/Native.hpp +++ b/src/Native.hpp @@ -609,15 +609,15 @@ inline std::function createFunctionWrapper(const Local& func namespace script { template -inline internal::type_t< - Local, std::void_t(), false))>> +inline internal::type_t, + decltype(internal::bindStaticFunc(std::declval(), false))> Function::newFunction(Func&& callback, bool nothrow) { return newFunction(internal::bindStaticFunc(std::forward(callback), nothrow)); } template -inline internal::type_t::toScript)>> -Local::set(const Local& key, T&& value) const { +inline internal::type_t::toScript)> Local::set( + const Local& key, T&& value) const { auto val = internal::TypeConverter::toScript(std::forward(value)); // static_cast is crucial!!! // force the compiler to choose the non-template version @@ -626,22 +626,22 @@ Local::set(const Local& key, T&& value) const { } template -inline internal::type_t::toScript)>> -Local::set(StringLike&& keyStringLike, T&& value) const { +inline internal::type_t::toScript)> Local::set( + StringLike&& keyStringLike, T&& value) const { auto val = internal::TypeConverter::toScript(std::forward(value)); set(String::newString(std::forward(keyStringLike)), static_cast&>(val)); } template -inline internal::type_t::toScript)>> -Local::set(size_t index, T&& value) const { +inline internal::type_t::toScript)> Local::set( + size_t index, T&& value) const { auto val = internal::TypeConverter::toScript(std::forward(value)); set(index, static_cast&>(val)); } template -inline internal::type_t::toScript)>> +inline internal::type_t::toScript)> InternalStoreHelper::set(T&& value) const { auto val = internal::TypeConverter::toScript(std::forward(value)); set(static_cast&>(val)); @@ -718,15 +718,15 @@ Exception::Exception(StringLike&& messageStringLike) : Exception(internal::extractStringLike(std::forward(messageStringLike))) {} template -inline internal::type_t::toScript)>> -ScriptEngine::set(const Local& key, T&& value) { +inline internal::type_t::toScript)> ScriptEngine::set( + const Local& key, T&& value) { auto val = internal::TypeConverter::toScript(std::forward(value)); set(key, static_cast&>(val)); } template -inline internal::type_t::toScript)>> -ScriptEngine::set(StringLike&& keyStringLike, T&& value) { +inline internal::type_t::toScript)> ScriptEngine::set( + StringLike&& keyStringLike, T&& value) { auto val = internal::TypeConverter::toScript(std::forward(value)); set(String::newString(std::forward(keyStringLike)), static_cast&>(val));