Sorry, fat-fingered things and the message was sent too early. trying again:
Hi all,
I am new to spirit, and my only source of information has been the
current spirit documentation. I am running into a curious problem in
which the manual suggests some code should compile, yet it does not.
Test case:
----------------------------------------------------------------------------------------------
#include
using namespace boost::spirit;
int main()
{
const char *s = "(1)";
rule<> r = ch_p('(') >> int_p >> ch_p(')');
parse(s, r); // compiles OK
parse(s, r, space_p); // does NOT compile
parse(s, ch_p('(') >> int_p >> ch_p(')'), space_p); // compiles OK
}
----------------------------------------------------------------------------------------------
Why does the third parse() compile, but not the second? Does the rule
require some kind of adaptor to work in this context?
Thanks,
-Gabe