FunctionResults LuaVariantImpl<Derived>::operator()(Args&&... args) { int t = type(); if (t == LUA_TTHREAD) { return this->template resume<FunctionResults>(std::forward<Args>(args)...); } else if (t == LUA_TFUNCTION) { return this->template call<FunctionResults>(std::forward<Args>(args)...); } else { except::typeMismatchError(state_(), " is not function or thread"); return FunctionResults(state_()); } }
inline RetType FunctionResultProxy::ReturnValue(lua_State* state, int return_status, int retindex, types::typetag<RetType> tag) { return FunctionResults(state, return_status, retindex).get_result(types::typetag<RetType>()); }
inline FunctionResults FunctionResultProxy::ReturnValue(lua_State* state, int return_status, int retindex, types::typetag<FunctionResults> tag) { return FunctionResults(state, return_status, retindex); }
inline void FunctionResultProxy::ReturnValue(lua_State* state, int retindex, types::typetag<void> tag) { FunctionResults(state, retindex); }