-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
More relevant might be exponential backoff, which would look much uglier if you had to test for whether or not there was a status.
e = function();
while ( e.status == timeout ) {
sleep(delay);
delay *=2;
}Here we have a value or a hard error. This use case would need to use something like has_error
e = function();
while ( has_error(e, timeout) ) {
sleep(delay);
delay *=2;
}where
template <class E, class T>
bool has_error(expected<E,T> const&, E err) {
if (e) return false;
else return error()==err;
}Do we need to add such a has_error function? as member?
Reactions are currently unavailable