diff options
author | 2017-02-05 16:01:50 +0100 | |
---|---|---|
committer | 2017-02-05 16:06:06 +0100 | |
commit | ac096aa2a0921efde96b76252dffb119dcf27efc (patch) | |
tree | 2ad9a28a7f6babce8cfcbf5995e3e055ff13ff60 /3rdparty/sol2/sol/protected_function.hpp | |
parent | 29df715138452ee18ba19ec4b07e18c4b3185de7 (diff) |
Update sol2 (nw)
Diffstat (limited to '3rdparty/sol2/sol/protected_function.hpp')
-rw-r--r-- | 3rdparty/sol2/sol/protected_function.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/3rdparty/sol2/sol/protected_function.hpp b/3rdparty/sol2/sol/protected_function.hpp index 583a8dd931f..0f188a1a677 100644 --- a/3rdparty/sol2/sol/protected_function.hpp +++ b/3rdparty/sol2/sol/protected_function.hpp @@ -161,11 +161,19 @@ namespace sol { basic_protected_function(proxy_base<Super>&& p, reference eh = get_default_handler()) : basic_protected_function(p.operator basic_function<base_t>(), std::move(eh)) {} template <typename Super> basic_protected_function(const proxy_base<Super>& p, reference eh = get_default_handler()) : basic_protected_function(static_cast<basic_function<base_t>>(p), std::move(eh)) {} + template <typename T, meta::enable<meta::neg<std::is_integral<meta::unqualified_t<T>>>, meta::neg<std::is_same<T, ref_index>>> = meta::enabler> + basic_protected_function(lua_State* L, T&& r, reference eh) : basic_protected_function(L, sol::ref_index(r.registry_index()), std::move(eh)) {} basic_protected_function(lua_State* L, int index = -1, reference eh = get_default_handler()) : base_t(L, index), error_handler(std::move(eh)) { #ifdef SOL_CHECK_ARGUMENTS stack::check<basic_protected_function>(L, index, type_panic); #endif // Safety } + basic_protected_function(lua_State* L, ref_index index, reference eh = get_default_handler()) : base_t(L, index), error_handler(std::move(eh)) { +#ifdef SOL_CHECK_ARGUMENTS + auto pp = stack::push_pop(*this); + stack::check<basic_protected_function>(L, -1, type_panic); +#endif // Safety + } template<typename... Args> protected_function_result operator()(Args&&... args) const { |