BOOST_FUSION_ADAPT_STRUCT doesn't take the right number of arguments

Viewed 1175

I am using Boost::Spirit to parse some text into structs. This requires using BOOST_FUSION_ADAPT_STRUCT for parsing text and directly storing into the structure. I know that the macro takes 2 arguments: the structure name as the 1st arg and all the structure members as the 2nd argument. And I am passing just those 2. But I get a compilation error saying,

error: macro "BOOST_FUSION_ADAPT_STRUCT_FILLER_0" passed 3 arguments, but takes just 2

Here is the code snippet. Let me know if you need the entire code.

Thanks.

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))

This is the rule I am trying to parse,

qi::rule<Iterator, Dir_Entry_Pair()> ppair  =   dir
                                                >>  '/'
                                                >>  entry
                                                >> -(keyword >> entry);
1 Answers
Related