
On Oct 1, 7:35 pm, OvermindDL1
On Fri, Oct 1, 2010 at 2:34 PM, alfC
wrote: can anybody explain to me why this example from the Spirit.Qi manual works
http://www.boost.org/doc/libs/1_44_0/libs/spirit/example/qi/complex_n...
and when I try to use the string iterators directly I get a horrific compiler error? Something to do with string iterators being pointers or something?
std::string s = "(2, 3)"; // < line added to example bool r = phrase_parse(s.begin(), s.end(), //< only line changed in the example was (first, last)
You are using GCC, phrase_parse's first parameter must be non-const.
right in the spot. Thank you. That worked.
I have another question in general on Spirit.Qi. I read the manual
many times and I still can't figure out how to read 'words' from the
parser. In the following example I want to parse the name of something
but I can not use the semantic assignment on std::string. ? The
pattern is matched if I disable the assignment line but it doesn't
compile with the line "[ref(name) = _1]". Again this is boost 1.43
with gcc 4.4.
#include