MCPcopy Create free account
hub / github.com/ThePhD/sol2 / sol_lua_check

Function sol_lua_check

examples/source/customization_multiple.cpp:12–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11template <typename Handler>
12bool sol_lua_check(sol::types<two_things>, lua_State* L,
13 int index, Handler&& handler,
14 sol::stack::record& tracking) {
15 // indices can be negative to count backwards from the top
16 // of the stack, rather than the bottom up to deal with
17 // this, we adjust the index to its absolute position using
18 // the lua_absindex function
19 int absolute_index = lua_absindex(L, index);
20 // Check first and second second index for being the proper
21 // types
22 bool success
23 = sol::stack::check<int>(L, absolute_index, handler)
24 && sol::stack::check<bool>(
25 L, absolute_index + 1, handler);
26 tracking.use(2);
27 return success;
28}
29
30two_things sol_lua_get(sol::types<two_things>, lua_State* L,
31 int index, sol::stack::record& tracking) {

Callers

nothing calls this directly

Calls 2

lua_absindexFunction · 0.85
useMethod · 0.80

Tested by

no test coverage detected