sol2/tests/test_stack_guard.hpp
2017-09-06 05:22:40 -04:00

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); }
};