
Hi Ami, Some answers are inline below... You were very close. Ami Ganguli wrote:
Here's the important bits of my code:
My function object:
struct append_element_impl { typedef void result_type; void operator()(std::string& text) const -----------------------^^^^^^^^^^^^^^^^^
Make this std::string const &. Note the const.
{ std::cout << "appending " << text; } }; function
::type const append_element = {{}}; The part of the parser that calls the function:
h1 = "=" >> +blank >> * (s1= ~_ln) >> eol [append_element(asstd::string(s1))];
---------------------------^^^^^^^^^^^^^^^ asstd::string should not be necessary. <snip>
/usr/local/include/boost/proto/context/default.hpp:357: error: return-statement with a value, in function returning 'void'
This one is a little strange. I assume you're using gcc. It's possible that once the other errors are corrected, this one will go away. If not, change the return type of append_element_impl to int, and return just 0. Hope that helps, -- Eric Niebler BoostPro Computing http://www.boostpro.com