[Spirit.Qi] I want to modify _val, how?

So, I was able to modify _1 (type of struct ptnode) by using a functor() (e.g. [_val = func(x, _1)] where the function will take a reference of _1 and do some modification to it and return (typeof(_1)&). Can we also modify _val placeholder on the fly through semantic action? i.e. once _val = _1 executed, then modify the _val object _________________________________________________________________ Hotmail: Trusted email with Microsoft's powerful SPAM protection. http://clk.atdmt.com/GBL/go/177141664/direct/01/ http://clk.atdmt.com/GBL/go/177141664/direct/01/

HT4N - wrote:
So, I was able to modify _1 (type of struct ptnode) by using a functor() (e.g. [_val = func(x, _1)] where the function will take a reference of _1 and do some modification to it and return (typeof(_1)&).
Can we also modify _val placeholder on the fly through semantic action? i.e. once _val = _1 executed, then modify the _val object
sure, i.e. arule[ _val=..., phx::bind(&someFunc, _val, ...)] No problem at all.

So, I was able to modify _1 (type of struct ptnode) by using a functor() (e.g. [_val = func(x, _1)] where the function will take a reference of _1 and do some modification to it and return (typeof(_1)&).
Can we also modify _val placeholder on the fly through semantic action? i.e. once _val = _1 executed, then modify the _val object
A semantic action [_val = _1] actually should modify the variable referenced by _val. If it doesn't work for you, please provide a _minimal_ example we could try. And, please move Spirit related discussions to the Spirit mailing list. There you will get more and faster answers. Regards Hartmut ------------------- Meet me at BoostCon http://boostcon.com
participants (3)
-
Christoph Duelli
-
Hartmut Kaiser
-
HT4N -