Boost logo

Boost Users :

From: Frank Mori Hess (fmhess_at_[hidden])
Date: 2007-02-25 15:39:08


On Sunday 25 February 2007 01:37 pm, Peter Dimov wrote:
> Frank Mori Hess wrote:
> > On Sunday 25 February 2007 12:39 pm, Peter Dimov wrote:
> > > I think I prefer:
> > >
> > > bool expired() const;
> > > R operator()( A... ) const; // throws bad_weak_ptr
> >
> > As I recall, the other objection raised by Timmo was the ambiguity as
> > to whether a caught bad_weak_ptr exception was thrown by the slot or
> > the underlying SlotFunction. In one case, the signal would just
> > disconnect the slot and move on. In the other, it would want to
> > rethrow the exception.
>
> Why would you want to rethrow a bad_weak_ptr exception? Its meaning is
> unambiguous; a weak_ptr has expired. This SlotFunction is most probably
> dead and is informing you of its sorry state.

Okay, but the other issue is the slot iterator has to know that the slot
has not (and will not) expire before calling it. This means an explicit
lock(), unless we commit to discarding the current combiner interface.

-- 
Frank



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