Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-08-11 06:07:38

troy d.straszheim wrote:
> Would seem reasonable to me to allow both and have the docs reflect
> that a cast is preferred, but if the consensus is to turn off the
> constructor-from-raw-pointer, if not now, when?

There is no consensus to turn off the raw pointer constructor. While
replacements are frequently being proposed - some of them predating
boost::shared_ptr - none of them have proven useful in practice; or if they
have, I am not aware of them. For now I'm inclined to think of this
recurring idea as something that looks good on paper but doesn't offer
significant benefits. Of course I may be wrong. ;-)

Another alternative is to tackle the problem at runtime. In a "safe mode"
with some help from the heap manager, it's possible for the pointer
constructor to detect invalid arguments (the current implementation has a
proof of concept). However, interestingly enough, none of the "safe mode"
STLs offer such safeguards for std::auto_ptr (to the best of my knowledge);
there's probably no demand.

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