I try some codes snippet from boost spirit, but it only incur a lot of error mesasges
After some struggle, I figured it out the compiler say it needs two argumentsCode:#include<iostream> #include<string> #include<boost/spirit/include/qi.hpp> void spirit_01() { namespace qi = boost::spirit::qi; std::string input("1.0,2.0"); std::pair<double, double> p; qi::parse(input.begin(), input.end(), qi::double_ >> ",">>qi::double_, p); //#1 }
the correct answer is
What am I lack to make #1 compile?ThanksCode:double a, b; qi::parse(input.begin(), input.end(), qi::double_ >> ",">>qi::double_, a, b);
I choose boost::spirit to develop some parsers and source codes generator
When I deal with something like xml or some repetitive codes, codes
generator could be very useful.
Although I consider that boost::regex could make the job done too, but learning
how to work with boost::spirit may give me more flexibility. Besides, I heard
that the performance of boost::spirit is splendid?


Reply With Quote
Bookmarks