
7 Jun
2004
7 Jun
'04
7:51 p.m.
"Eric Niebler" <eric@boost-consulting.com> writes:
I have a new idea. Deep copy can be triggered by assigning to a dummy member:
rule<> a, b; a.rule = parser >> that >> refers >> to >> b; b.rule = parser >> that >> refers >> to >> a;
This allows: a = b; // shallow copy, creates alias a.rule = b.rule; // deep copy, modifies 'a' and all its aliases
xpressive now works this way. It's heavier syntactically, but far less confusing then using a special deep-assign operator.
I think a->rule = b->rule would be much more consistent with the other semantics of this thing. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com