On Fri, Sep 25, 2009 at 1:21 PM, Christian Henning
Hi there, I really liked the assign_a actor in classic spirit. Is there something like that in spirit 2.1, aka, spirit::qi?
That is because something like assign_a is worthless in QI. For example (from the docs), in Spirit.Classic: int i, j; std::string s; r = int_p[assign_a(i)] >> (+alpha_p)[assign_a(s)] >> int_p[assign_a(j,i)]; Can be done in Spirit.QI by: int i, j; std::string s; r = int_[ref(i)=_1] >>(+alpha)[ref(s)=_1] >> int_[ref(j)=_1]; Or even better, this will do the same thing, but will execute even faster: int i, j; std::string s; std::string str("123456 Hello 789"); phrase_parse(str.begin(), str.end(), int_ >> +alpha >> int_, blank, i,s,j); // This will stuff 12345 into i, "Hello" into S, and 789 into j, *very* fast. Spirit2.1 is *so* much better, as you might be seeing. :)