Luaで記述されたキュークラスの既存の実装をSTLキュークラスに置き換えようとしています。なぜこれが失敗するのか、またはそれを修正する方法がわかりません。以下は、エラー出力とともに同じ動作を示すサンプルコードです。前もって感謝します!
#include <luabind / luabind.hpp> #include <queue> 構造体XYZ_T {{ 短いx、y、z; }; typedef std :: queue <XYZ_T> XYZ_QUEUE_T; extern "C" int init(lua_State * L) {{ 名前空間luabindを使用します。 open(L); モジュール(L) [ class_ <XZY_T>( "XYZ_T") .def(コンストラクタ<>()) .def_readwrite( "x"、&XYZ_T :: x) .def_readwrite( "y"、&XYZ_T :: y) .def_readwrite( "z"、&XYZ_T :: z)、 class_ <XYZ_QUEUE_T>( "XYZ_QUEUE_T") .def(コンストラクタ<>()) .def( "push"、&XYZ_QUEUE_T :: push) .def( "pop"、&XYZ_QUEUE_T :: pop) .def( "front"、&XYZ_QUEUE_T :: front) .def( "back"、&XYZ_QUEUE_T :: back) .def( "empty"、&XYZ_QUEUE_T :: empty) .def( "size"、&XYZ_QUEUE_T :: size) ]; }
そしてgcc出力:
g ++ -o test_luabind.os -c -fPIC -Iinclude -I $ VALID_INCLUDE_DIR / packages / build_env / include test_luabind.cpp test_luabind.cpp:関数 `int init(lua_State *)': test_luabind.cpp:27:エラー:`の呼び出しに一致する関数がありません luabind :: class_ <XYZ_QUEUE_T、luabind :: detail :: unspecificed、 luabind :: detail :: unspecified、luabind :: detail :: unspecific> :: def(const char [6]、<不明なタイプ>) ' test_luabind.cpp:32:エラー: `('トークンの前にエラーを解析します