mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
88155d44e0
sol::this_state is a transparent argument that gets the current state at any position in any callback sol::variadic_args allows a person to get something that can reference the "rest of the arguments", though it doesn't enforce that it has to be the last argument Closes #57 Closes #59 Closes #60
12 lines
298 B
C++
12 lines
298 B
C++
#pragma once
|
|
|
|
struct test_stack_guard {
|
|
lua_State* L;
|
|
int& begintop;
|
|
int& endtop;
|
|
test_stack_guard(lua_State* L, int& begintop, int& endtop) : L(L), begintop(begintop), endtop(endtop) {
|
|
begintop = lua_gettop(L);
|
|
}
|
|
~test_stack_guard() { endtop = lua_gettop(L); }
|
|
};
|