Hello,

Please see the attached proposal. The abstract makes a good summary:

nullopt_t can be three-way compared to optional. However, because there is no operator<=> or operator== between nullopt_ts, optional is not comparison_relation_with nullopt_t where comparison_relation_with is any of equality_comparable_with, totally_ordered_with, or three_way_comparable_with. Adding a trivial operator<=> for nullopt_t allows comparison_relation_with to support optional + nullopt_t. The same holds true with nullptr_t and unique_ptr<T> and shared_ptr<T>.

To expand a little bit more, in isolation, relational operators for nullptr and nullopt can easily be made, but they would have no use. However, when considered in the context of smart_ptr<T> and optional<T> respectively, the cross-type relations operator@(foo<T>, nullfoo_t)s need operator@(foo<T>, foo<T>) and also operator@(nullfoo_t, nullfoo_t) before we can meet the respective *_with concept. Adding relational operators to nullptr and nullopt have no harm, but let these types meet the *_with concepts as they should.

Thanks,
Justin Bassett