Having failed to find this elsewhere in boost, or in spirit, I rolled my
own - and it turned out to be a lot simpler than I expected:-
struct assign_member_impl
{
template
Is there any standard way, in a semantic action, to assign individual elements of a struct that is set as a member of a closure? For example suppose I have:-
struct foo { int a, b, c; std::string d; float e; };
And I have this as member1 in my closure, which is then attached to a rule that parses each of those struct member elements seperately, is there then a standard way within the semantic actions in my rule to assign to foo.d, say, without modifying the other values? It seems that my only option is to either write my own functors to set each member seperately, or have the individual elements as seperate members of my closure.
I kind of want to do something like this: myrule = int_p[assign_a(myrule.m1.a)] >> int_p[assign_a(myrule.m1.b)]; But myrule.m1 is an actor, not an instance of foo.
Is there a way to do this with boost::bind perhaps?
I want to use closures since my rules need to be reentrant.
Mark