Boost logo

Boost Users :

From: me22 (me22.ca_at_[hidden])
Date: 2005-10-01 01:43:17


On 30/09/05, John Sun <jsunnewsgroup_at_[hidden]> wrote:
> Appreciate your help, can you explain what's the rationale that you use
> "reset" instead of a simple more natural way of "assign".
>

For one, that's the way that auto_ptr does it.

Second, plain assignment can cause hidden bugs because it would take
ownership of something in the middle where it's hard to notice. You
can just construct a new smart pointer and assign the temporary to the
one you want to change, anyways.

- Scott


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