mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
g++ makes me sad
This commit is contained in:
parent
17c1dde68e
commit
c01f15ca95
|
@ -36,8 +36,12 @@ struct functor_function : public base_function {
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
functor_function(Args&&... args): fx(std::forward<Args>(args)...) {}
|
functor_function(Args&&... args): fx(std::forward<Args>(args)...) {}
|
||||||
|
|
||||||
|
int call(lua_State* L) {
|
||||||
|
return stack::call_into_lua(meta::tuple_types<return_type>(), args_types(), fx, L, 1);
|
||||||
|
}
|
||||||
|
|
||||||
virtual int operator()(lua_State* L) override {
|
virtual int operator()(lua_State* L) override {
|
||||||
auto f = [&](lua_State* L) -> int { return stack::call_into_lua(meta::tuple_types<return_type>(), args_types(), fx, L, 1);};
|
auto f = [&](lua_State* L) -> int { return this->call(L);};
|
||||||
return detail::trampoline(L, f);
|
return detail::trampoline(L, f);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -64,8 +68,12 @@ struct member_function : public base_function {
|
||||||
template<typename Tm, typename... Args>
|
template<typename Tm, typename... Args>
|
||||||
member_function(Tm&& m, Args&&... args): fx(std::forward<Tm>(m), std::forward<Args>(args)...) {}
|
member_function(Tm&& m, Args&&... args): fx(std::forward<Tm>(m), std::forward<Args>(args)...) {}
|
||||||
|
|
||||||
|
int call(lua_State* L) {
|
||||||
|
return stack::call_into_lua(meta::tuple_types<return_type>(), args_types(), fx, L, 1);
|
||||||
|
}
|
||||||
|
|
||||||
virtual int operator()(lua_State* L) override {
|
virtual int operator()(lua_State* L) override {
|
||||||
auto f = [&](lua_State* L) -> int { return stack::call_into_lua(meta::tuple_types<return_type>(), args_types(), fx, L, 1);};
|
auto f = [&](lua_State* L) -> int { return this->call(L);};
|
||||||
return detail::trampoline(L, f);
|
return detail::trampoline(L, f);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user