sol2/test_stack_guard.hpp
ThePhD c458849d29 Many of the tests are still busted, but we're getting closer.
Closes #96
Closes #79
Fixes #105 - but we still need to double-check and add a test to prove it
2016-06-06 15:46:53 -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); }
};