我想从 Lua 代码中调用一些 C++ 函数并在参数中传递 Lua 表,如下所示:
call_cpp_function_from_lua({ x = 10, y = 20 })
在call_cpp_function_from_lua
我想获取并使用迭代器来表示 Lua 表的 C++,如下所示:
std::map<boost::variant<LuaTypesList>, boost::variant<LuaTypesList>>::iterator it = getLuaTableBegin();
我可以使用 C API 来执行此操作,但它很乏味且容易出错,请参阅Iterating through a Lua table from C++? .