On Mon, Jun 24, 2019 at 10:37 AM Brian Bi via Std-Discussion <std-discussion@lists.isocpp.org> wrote:
The authors do not seem to have considered the possibility of having the mixed comparison operators throw an exception upon encountering a disengaged optional, but they did consider the possibility of having them simply cause a compilation error. We don't know why, but it seems to me that, if you really believe that this usage is almost always a bug, then you should want that bug to be caught at compile time. But it doesn't appear that the authors shared your view that it's almost always a bug. Instead, they claimed that some users of Boost.Optional found the mixed comparison operators useful.

You don't want your comparison operations to throw (for instance, it breaks transparent comparisons aka less<void>, etc.) nor use exceptions to indicate programming bugs (as those become indistinguishable from expected behavior the developer is counting upon).
--
 Nevin ":-)" Liber  <mailto:nevin@cplusplusguy.com>  +1-847-691-1404