Boost logo

Boost Users :

Subject: Re: [Boost-users] scoped_ptr::release (again)
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-02-24 14:09:46


AMDG

Nat Goodspeed wrote:
> Steven Watanabe wrote:
>
>> Nat Goodspeed wrote:
>
>>> If I have a class that supports assignment, and my class uses
>>> scoped_ptr to manage some resource...
>
>> The question is not whether swap is useful, but whether it should
>> be part of scoped_ptr rather than another smart pointer.
>
> Of course you're right.
>
> But if scoped_ptr is in all other ways the best tool for the job,
> should my class's requirement for an assignment operator force me to
> change to another smart pointer instead?

Since swap already exists, it should certainly not be removed.
If it didn't I could argue either way. As far as I am concerned,
having to use a different smart pointer is not a problem per se
as long as it doesn't introduce a performance penalty. (e.g.
shared_ptr). The main issue is a keeping a consistent set of
invariants. If we add all the "one little features" that anyone
needs, the result will be to turn scoped_ptr into unique_ptr.

In Christ,
Steven Watanabe


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