9 Feb
2007
9 Feb
'07
8:21 p.m.
Frank Mori Hess wrote:
I'm noticing now that boost::last_value isn't thread-safe when used with a non-void return value, since a thread can't in general be sure the signal will have any slots connected to it when it is invoked. Would it be acceptable to make last_value throw an exception on the non-void, no slots case? Throwing an exception seems preferable to the dreaded "undefined behaviour". Or we could use a slightly modified default combiner with a different name.
Returning an Optional if T is default constructible seems like a viable refinement of that solution. I'm a little uncomfortable with exceptions being thrown potentially everywhere along the call chain as a default behaviour. Regards Timmo Stange