On Sun, Oct 4, 2020 at 7:26 PM Jason McKesson via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
And it doesn't make sense for `optional` to allow any kind of "no
value" type. You can't have a NothingOrNothing type ;)

Sure it does. optional<void> still has two states: engaged nothing and disengaged. It may seem like a weird spelling of bool, but it's a perfectly meaningful type and fills a hole in the type system.

For instance, we could consider adding a member function ok() to expected<T, E> that returns an optional<T> (Rust's Result has such a function, for instance). Perhaps you have some generic code that might want to drop the error for whatever reason. The inability to define such a function for void is yet anotherĀ really annoying scenario where void has to be treated specially. The same holds for any generic operation on an optional, really.

Barry