1
all。私はluabindを使ってluaスクリプトから配列を読み込むことで、見知らぬ問題が発生しました。ルアビンド0.9.1イテレータは常に最後のオブジェクトをポップします
LUAスクリプトは、次のようになります
root =
{
id = 1,
id = 2,
id = 3
};
およびC++コードでは、このようになります。 luabind ::オブジェクトdata_root = luabind ::グローバル(L) "ルート"]。
id:3
私は出力に[ルート]の全ての要素をしたいが、それだけ出力最後の1以上:
for (luabind::iterator i(data_root), end; i != end; ++i)
{
luabind::object data = *i;
unsigned int id = luabind::object_cast<unsigned int>(data);
std::cout << "id:" << id << std::endl;
}
出力のみです。
は、ジェイソンありがとう:)ルートの複数の要素がありません
ありがとうございます! :) –