简体   繁体   中英

Boost spirit parser attribute type not working.

int main() {
    std::string input("A90 (a-><>b)");
    std::string::iterator strbegin = input.begin();
    map<char, int> p;
    qi::phrase_parse(strbegin, input.end(),
    (qi::char_ >> qi::int_) % ':', // parser grammar
    qi::space, // delimiter grammar
    p); // attribute to fill while parsing
    return 0;
}

This code gives me error -

error: no matching function for call to ‘std::pair<char, int>::pair(const char&)’

and I am clueless on it.

您需要包括"boost/fusion/include/std_pair.hpp"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM