From: "David B. Held" <[EMAIL PROTECTED]>
> "Peter Dimov" <[EMAIL PROTECTED]> wrote in message
> 004501c2c6f8$970c7400$1d00a8c0@pdimov2">news:004501c2c6f8$970c7400$1d00a8c0@pdimov2...
> > From: "David B. Held" <[EMAIL PROTECTED]>
> > [...]
> > 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?

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to