Niall Douglas wrote:
I have been persuaded by argument here that default construction to empty is in fact a defect in the design. The formal empty state ought to *always* be explicitly constructed, and **never** occur implicitly. I have logged this defect to https://github.com/ned14/boost.outcome/issues/44.
I don't think I agree with that. The whole point of having a singular empty state is to default-construct to it so that the mistake of failing to assign to the default-constructed result/outcome can be detected. This: result<T> function() { result<T> r; // do things that put something into r return r; } where the "do things" part sometimes fails to put something into r. If you don't default-construct to empty, you pretty much lose the point of having empty.