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

Function fallback

examples/source/calling_lua_functions.cpp:14–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12}
13
14sol::variadic_results fallback(
15 sol::this_state ts, sol::variadic_args args) {
16 sol::variadic_results r;
17 if (args.size() == 2) {
18 r.push_back({ ts,
19 sol::in_place,
20 args.get<int>(0) + args.get<int>(1) });
21 }
22 else {
23 r.push_back({ ts, sol::in_place, 52 });
24 }
25 return r;
26}
27
28int main(int, char*[]) {
29 std::cout << "=== calling lua functions ===" << std::endl;

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected