luaaa icon indicating copy to clipboard operation
luaaa copied to clipboard

How to handle multiple return values, as Lua supports multiple return values

Open z1485671578 opened this issue 1 year ago • 1 comments

I have a C++DLL file that I want to register the get type function to the Lua virtual machine. However, the get method needs to return the function execution value and also the obtained value. So, how do I handle these multiple return values? Can I use this template to register to the Lua virtual machine

z1485671578 avatar Mar 28 '24 16:03 z1485671578

use std::tuple to return multiple values from c++ to lua, it will be extracted to a table in lua.

there is an example testTuple()/testTuple2() in example.cpp.

gengyong avatar Apr 10 '24 20:04 gengyong