#include <iostream> #include <boost/spirit/include/qi.hpp> int main() { std::string src = "123456789"; int a, b, c; namespace qi = boost::spirit::qi; bool result = qi::phrase_parse( src.begin(), src.end(), qi::raw[ qi::repeat(2)[qi::digit] ] >> qi::raw[ qi::digit >> qi::digit ] >> qi::int_ , qi::ascii::space, a, b, c ); if( result ) std::cout << a << "," << b << "," << c << std::endl; else std::cout << "fault" << std::endl; return 0; }
0 件のコメント:
コメントを投稿