【发布时间】:2017-03-29 09:20:32
【问题描述】:
Coliru 上的简单解析器。解析器 -(+x3::alpha) 应该能够像 Qi 一样传播 boost::optional<std::string> 类型的属性。但它不编译。
std::string const input = "abc";
boost::optional<std::string> attr;
if(x3::parse(boost::begin(input),boost::end(input),
-(+x3::alpha),
attr)) {
std::cout<<"match!"<<std::endl;
}
else {
std::cout<<"NOT match!"<<std::endl;
}
【问题讨论】:
标签: c++ boost boost-spirit boost-spirit-qi boost-spirit-x3