on-internet
← Community

Why is null std::optional considered less than any value, not more

Stack Overflow ·

Is there any math sense in having a disengaged (i.e. "empty") std::optional comparing as less than an engaged optional, holding a value? Or - is it this way only for consistency, and there would have been no any difference if it was "more" instead of "less"?

Comments

Sign in or sign up to comment and upvote.

No comments yet.