Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-01-29 07:25:08


From: "David B. Held" <dheld_at_[hidden]>
> "Peter Dimov" <pdimov_at_[hidden]> wrote in message
> news:004501c2c6f8$970c7400$1d00a8c0_at_pdimov2...
> > From: "David B. Held" <dheld_at_[hidden]>
> > [...]
> > Nope, but I want my sink strongly exception safe; the pointer should
> > be deleted when a policy constructor throws.
>
> Hmm...that's not a bad point. A function try block should make this
> possible, no?

To be honest, I don't know. The design is quite complicated, and I don't
have the time to study it in-depth. I'm not sure how this interacts with
stored_type being a smart pointer that owns the object.

See also:

        friend inline void release(this_type& sp, stored_type& p)
        {
            checking_policy::on_release(storage_policy::storage());
            p = get_impl_ref(sp);
            get_impl_ref(sp) = storage_policy::default_value();
            ownership_policy& op = sp;
            op = ownership_policy();
        }

I'm not sure whether this works as intended if ownership_policy() throws.

> > Yes, I understand that, but do you know of a user that needs an
> > almost_auto_ptr? ;-)
>
> Given how often people write auto_ptr<> without writing auto_ptr<>,
> I'd say yes. ;>

How often do people write pointers that use the auto_ptr_ref trick?


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