Exemplo n.º 1
0
		stack_reference(lua_State* L, const stack_reference& r) noexcept
		: luastate(L) {
			if (!r.valid()) {
				index = 0;
				return;
			}
			int i = r.stack_index();
			if (detail::xmovable(lua_state(), r.lua_state())) {
				lua_pushvalue(r.lua_state(), r.index);
				lua_xmove(r.lua_state(), luastate, 1);
				i = absolute_index(luastate, -1);
			}
			index = i;
		}
Exemplo n.º 2
0
	inline bool operator!=(const lua_nil_t&, const stack_reference& rhs) {
		return rhs.valid();
	}
Exemplo n.º 3
0
	inline bool operator!=(const stack_reference& lhs, const lua_nil_t&) {
		return lhs.valid();
	}
Exemplo n.º 4
0
	inline bool operator==(const stack_reference& l, const stack_reference& r) {
		return lua_compare(l.lua_state(), l.stack_index(), r.stack_index(), LUA_OPEQ) == 0;
	}
Exemplo n.º 5
0
		basic_function(const stack_reference& r) : basic_function(r.lua_state(), r.stack_index()) {}
Exemplo n.º 6
0
		thread(const stack_reference& r) : thread(r.lua_state(), r.stack_index()) {};