Boost logo

Boost Users :

From: Gabriel Redner (gredner_at_[hidden])
Date: 2006-06-07 22:18:58


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 <boost/spirit/core.hpp>
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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net