【发布时间】:2017-12-29 17:16:21
【问题描述】:
Spirit X3 解析器函数在使用 1 个属性时效果很好。当我尝试从具有多个属性的documentation 编译代码时,它不起作用。
#include <boost/spirit/home/x3.hpp>
#include <iostream>
using namespace std;
using namespace boost::spirit;
string a = "3.2 4.5";
auto begin = a.begin();
auto end = a.end();
double d1 = 0.0, d2 = 0.0;
x3::phrase_parse(begin, end ,
x3::double_ >> x3::double_,
x3::space,
d1, d2); // doesn't work. Accept only 1 attribut
它返回以下错误:
/home/sacha/Dev/vql/vqlcompiler.cpp:20: erreur : no matching function for call to ‘phrase_parse(__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >&, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >&, boost::spirit::x3::sequence<boost::spirit::x3::real_parser<double>, boost::spirit::x3::real_parser<double> >, const space_type&, double&, double&)’
x3::double_ >> x3::double_, x3::space, d1, d2);
^
似乎它不是可变参数模板。那么,是我还是文档?
【问题讨论】:
标签: c++ boost c++14 boost-spirit boost-spirit-x3