mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
c458849d29
Closes #96 Closes #79 Fixes #105 - but we still need to double-check and add a test to prove it
12 lines
273 B
C++
12 lines
273 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); }
|
|
};
|