summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/sol2/test_stack_guard.hpp
blob: d77ffb8b6825f459abaa8c9cb21e346f2d47e347 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#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); }
};