You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The set_value, set_error and set_stopped CPOs all all currently defined as expression equivalent to a call to the corresponding member function on the receiver, mandating that the call-expression is nothrow.
There is, however, no constraint here to require that the expression is void.
As the specification currently stands, it would be valid to define a receiver with a set_value() method that returned bool, or indeed any other type, and this would still be a valid implementation of a receiver, and the CPO would need to return whatever value the member-function returned.
I wonder whether we'd be better off here requiring the receiver methods to return void so that we reserve future design space for possibly adding semantics to receiver methods that return non-void in future?
The text was updated successfully, but these errors were encountered:
I don't see downsides for adding such limitation (might save room for defining extended error / status handling in the future?). @ericniebler@RobertLeahy - WDYT?
The
set_value
,set_error
andset_stopped
CPOs all all currently defined as expression equivalent to a call to the corresponding member function on the receiver, mandating that the call-expression is nothrow.There is, however, no constraint here to require that the expression is
void
.As the specification currently stands, it would be valid to define a receiver with a
set_value()
method that returnedbool
, or indeed any other type, and this would still be a valid implementation of a receiver, and the CPO would need to return whatever value the member-function returned.I wonder whether we'd be better off here requiring the receiver methods to return
void
so that we reserve future design space for possibly adding semantics to receiver methods that return non-void in future?The text was updated successfully, but these errors were encountered: