v1.3
support std::tuple now so we can return multiple values from c++ to Lua likes below.
void func1(const std::tuple<int, float, std::string>& args) {
// do some things here ...
}
auto func2() {
return std::make_tuple(123, "string A", "string B", 0.123f);
}
LuaModule testMod(L, "TestMod");
testMod.fun("modFunc1", func1);
testMod.fun("modFunc2", func2);
in Lua:
TestMod.modFunc1(1, 1.2, "from lua to c")
local values = TestMod.modFunc2()
print("Lua got multiple values from c++:")
for i = 1, #values do
print("[" .. i .. "]" .. values[i])
end