
9 Jan
2011
9 Jan
'11
10:56 p.m.
Hi Eric,
Right. Either way, how should I deal with copy construction? Is the deeply copied thing automatic for copy construction? Or, should I make another deep copy each time?
A Proto expression that has been passed through proto::deep_copy owns all its sub-objects. The default copy constructor should just do the right thing.
So, do I understand it correctly that there won't be any double-deletion in the following code: auto ex1 = lit(1) + 3; { auto ex2 = ex1; } ex2 will copy everything in ex1, right? (OK, except for function references.) Thanks, --Hossein