簡體   English   中英

Boost精神分析器屬性類型不起作用。

[英]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;
}

此代碼給我錯誤-

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

我對此一無所知。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM