
Joel de Guzman wrote:
On expressions:
r %= some-expression;
The rule's operator%= kicks in. However, on expressions:
r %= r2; // r and r2 has the same type
Then proto %= kicks in leaving it as a no-op. Nothing happens. Hence, the rhs is never "auto-assigned" to the lhs.
I'm not sure how to deal with this. Do you have a hint? I place the original test code here. Tracing the code, the first %= works as expected while the second and third becomes no-ops calling proto operator %=.
You can disable proto's operator%= by specifying a domain with a grammar to proto::extends as described in the docs. You could also try defining a rule::operator%=(rule) member and see if that one gets picked up. -- Eric Niebler BoostPro Computing http://www.boostpro.com