14 May
2017
14 May
'17
9:21 p.m.
Niall Douglas wrote:
outcome<T>, result<T> and option<T> all have formal empty states as part of their programming model. They are quite useful for a multitude of uses, I mainly have used them to early out from a sequence of monadic operations or to signal an abort from a noexcept function.
Would you mind going into more detail with respect to the use cases? What does returning an empty result mean to the caller, conceptually? The idea of these result types is to return either a value or a reason for the lack of value, and an empty state is lacking both the value and the explanation for why the value is missing.