
On 03/29/2006 06:44 AM, Paul Mensonides wrote:
[mailto:boost-bounces@lists.boost.org] On Behalf Of Larry Evans
Or maybe I'm misunderstanding your definition of "safe"?
One way that it is safer is in sequence points, e.g.
f( shared_ptr<X>(new X(1, 2, 3)), shared_ptr<Y>(new Y(1, 2, 3)) );
f( make_shared_ptr<X>(1, 2, 3), make_shared_ptr<Y>(1, 2, 3) );
The latter is safe, whereas the former is not.
THanks, thar clears things up. I guess I should have remembered that post that started all this from Vaclav with subject: [shared_ptr] Best Practices - new_shared_ptr and that cited: http://www.gotw.ca/gotw/056.htm The phrase "exeption safe" would have helped my memory. I guess exception safety is why you use "sequence points" above, although I'm not very exception safe aware; so, I could be wrong. Maybe I should read more carefully Sutter's _Exceptional C++_ ?