Boost::Spirit を使用して、一部のテキストを構造体に解析しています。これには、テキストを解析して構造体に直接格納するために BOOST_FUSION_ADAPT_STRUCT を使用する必要があります。マクロは 2 つの引数を取ることを知っています。最初の引数として構造体名、2 番目の引数としてすべての構造体メンバーです。そして、私はそれらの2つだけを渡しています。しかし、コンパイルエラーが発生します。
error: macro "BOOST_FUSION_ADAPT_STRUCT_FILLER_0" passed 3 arguments, but takes just 2
これがコードスニペットです。コード全体が必要な場合はお知らせください。
ありがとう。
namespace client
{
namespace qi = boost::spirit::qi;
namespace ascii = boost::spirit::ascii;
namespace phoenix = boost::phoenix;
struct Dir_Entry_Pair
{
std::string dir;
std::string value1;
std::pair<std::string, std::string> keyw_value2;
};
}
BOOST_FUSION_ADAPT_STRUCT(
client::Dir_Entry_Pair,
(std::string, dir)
(std::string, value1)
(std::pair< std::string, std::string >, keyw_value2))
これは私が解析しようとしているルールです。
qi::rule<Iterator, Dir_Entry_Pair()> ppair = dir
>> '/'
>> entry
>> -(keyword >> entry);