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

Function sol_lua_check

examples/source/customization_convert_on_get.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<number_shim>, lua_State* L,
13 int index, Handler&& handler,
14 sol::stack::record& tracking) {
15 // check_usertype is a backdoor for directly checking sol2
16 // usertypes
17 if (!sol::stack::check_usertype<number_shim>(L, index)
18 && !sol::stack::check<double>(L, index)) {
19 handler(L,
20 index,
21 sol::type_of(L, index),
22 sol::type::userdata,
23 "expected a number_shim or a number");
24 return false;
25 }
26 tracking.use(1);
27 return true;
28}
29
30number_shim sol_lua_get(sol::types<number_shim>, lua_State* L,
31 int index, sol::stack::record& tracking) {

Callers

nothing calls this directly

Calls 2

type_ofFunction · 0.85
useMethod · 0.80

Tested by

no test coverage detected