I can't get a modified version of the example provided in boost's documentation to output correctly
Here's the documentation on sequential OR parser: http://www.boost.org/doc/libs/1_56_0/libs/spirit/doc/html/spirit/qi/reference/operator/sequential_or.html
test_parser("123.456", int_ || ('.' >> int_)); // full
I want this expression to populate a vector<int>
with 2 entries:
[0] = 123
[1] = 456
Why doesn't this work?
string input("123.456");
vector<int> output;
string::iterator i = input.begin();
parse(i, input.end(), int_ || ('.' >> int_), output);
I have verified parse returns true
and i == input.end()
. I have also tried different data structures for output including tuples with optionals, and vectors of optionals. And they all produce a single entry containing just 123, never 456.