Boost logo

Boost :

From: Dave Abrahams (abrahams_at_[hidden])
Date: 1999-07-14 07:05:30

> I would tend to disagree: auto_ptr got broken because simplistic
> features were added to it -- in terms of design, they introduced more
> problems than they solved. That this was (and is) the case is simple to
> demonstrate, which begs the question of why that design went off the
> rails in the first place (that was rhetorical >:->).

Reasonable people could disagree about this. Personally, I feel the current
auto_ptr design is superior to any of the previous ones (once you figure out
how to implement it - a non-trivial job)!

> However, returning to the point, the idea of adding a nocount is not
> really adding a new type of smart ptr at all. It simply allows more
> flexible use of the library. The introduction of a shared count for 1
> allows a simple optimisation for a common case, and a resolution of the
> construction problem (ctors would then never fail).

Why do you think that it's less problematic to have a smart ptr that can
throw when copied and assigned than one that can throw when initially

Personally, I find the exception behavior of shared_ptr quite convenient.


------------------------------------------------------------------------ home: - Simplifying group communications

Boost list run by bdawes at, gregod at, cpdaniel at, john at