簡単なパーサー テストLive On Coliruでは、
std::string str("x123x");
boost::iterator_range<boost::range_iterator<decltype(str)>::type> attr;
if( x3::parse( boost::begin(str), boost::end(str), x3::lit('x') >> x3::raw[+x3::digit] >> x3::lit('x'), attr ) ) {
std::cout<<"Match! attr = "<<attr<<std::endl;
} else {
std::cout<<"Not match!"<<std::endl;
}
パーサー
x3::lit('x') >> x3::raw[+x3::digit] >> x3::lit('x')
type の属性を合成することになっていますboost::iterator_range<Iterator>
。しかし、それはコンパイルできません。2 つの のいずれかを削除すると、x3::lit('x')
コンパイルされます。Live on Coliru でも、同じコードが qi でコンパイルされます。