Boost logo

Boost Users :

Subject: Re: [Boost-users] [Proto] Storing an Expression Template as a Data Member
From: Hossein Haeri (powerprogman_at_[hidden])
Date: 2011-01-09 17:56:47


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net