
10 Jan
2011
10 Jan
'11
11:16 a.m.
Hi Eric,
auto ex1 = lit(1) + 3;
Don't EVER do this.
Oops! Out of habit; I currently don't use C++0x and therefore do that using BOOST_PROTO_AUTO -- not used to using deep_copy thus...
auto ex1 = proto::deep_copy( lit(1) + 3 );
{ auto ex2 = ex1; }
ex2 will copy everything in ex1, right? (OK, except for function references.)
Right.
Cool. Then, I suggest that you do make this (more) clear in the Proto docs. Maybe you'd even like to add a subsection on how to store Proto expressions as data members and then also include a note on the sufficiency of default copy constructors. Thanks, --Hossein