【问题标题】:Boost spirit parser attribute type not working.Boost Spirit 解析器属性类型不起作用。
【发布时间】:2014-05-14 05:31:13
【问题描述】:
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;
}

这段代码给了我错误 -

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

我对此一无所知。

【问题讨论】:

    标签: c++ boost boost-spirit boost-spirit-qi


    【解决方案1】:

    你需要包含"boost/fusion/include/std_pair.hpp"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-31
      • 1970-01-01
      相关资源
      最近更新 更多