
25 Feb
2007
25 Feb
'07
6:37 p.m.
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.