Boost logo

Boost :

From: Dirk Gerrits (dirkg_at_[hidden])
Date: 2002-06-18 05:52:00


>> It's bad because it introduces a dependency, without
>> adding significant value (IMHO).
>
>
> Most of us don't change <memory> on a regular basis.
> So why is the dependency problematic? What do you
> lose from it? I would like to have this, but for me,
> this would be syntactic sugar, since I can accomplish
> the same thing with calling release() before passing
> it to the constructor. Besides, standard library headers
> sometimes include a lot more than you might think they
> include. I think dependencies should be few, but
> dependencies are not that bad when the element they
> depend on is pretty much constant.

I concur. Besides, what significant value does auto_ptr introduce in
shared_ptr? I'd either have both of them contain a constructor from
auto_ptr or neither.

>> Declare the auto_ptr const. This comes very close to the
>> behavior of scoped_ptr, with the exception that you
>> can reset the scoped_ptr, but not the auto_ptr.
>
>
> And you force initialization in the constructor
> initialization list if it is a class member.

And scoped_ptr uses checked_delete to reject incomplete types, right?

Regards,
Dirk Gerrits


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk