
7 Jun
2004
7 Jun
'04
9:14 p.m.
David Abrahams wrote:
"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.
<nods> Much better. I like. -- Eric Niebler Boost Consulting www.boost-consulting.com