C++ Logo


Advanced search

Re: nullptr_t and nullopt_t should both have operator<=> and operator== to enable the *_with concepts

From: Justin Bassett <jbassett271_at_[hidden]>
Date: Thu, 8 Jul 2021 23:49:04 -0700
Hi Giuseppe,

Thanks for the insight. I don't know much about the different working
groups. What are the different groups, and what does it mean if I target
them (other than putting them under "Audience")? How do I know which groups
to target?

For your second point, I'll add a note pointing to my other proposal that
fixes that.


On Thu, Jul 8, 2021 at 2:08 AM Giuseppe D'Angelo via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> Hi,
> On 08/07/2021 07:15, Justin Bassett via Std-Proposals wrote:
> > Adding relational operators to nullptr and nullopt have no harm, but let
> > these types meet the *_with concepts as they should.
> Thank you very much for this. Indeed singular values that are comparable
> for (in)equality do already model strong_ordering, so C++ should just
> reflect that in the language/library (with the provision that we don't
> want to introduce things like `nullptr < ptr`). nullopt_t isn't already
> comparable but it doesn't make much sense for it not to be.
> Just a couple of notes:
> * you may want to target EWG (as well as LEWG) as you're proposing
> changes to the language;
> * in some cases the changes bring us a step closer to satisfying the
> comparison concepts, but still those won't be satisfied due to other
> (pre-existing) issues. For instance
> std::three_way_comparable_with<std::unique_ptr<X>, std::nullptr_t>
> is still false/unsatisfied because `std::unique_ptr` isn't copiable.
> Mut.mut. for `std::optional<some_move_only_type>` and `nullopt_t`, and
> also `std::equality_comparable_with` -- all of this stems from
> `std::common_reference_t`. Probably worth just adding as a note.
> Thank you again,
> --
> Giuseppe D'Angelo | giuseppe.dangelo_at_[hidden] | Senior Software Engineer
> KDAB (France) S.A.S., a KDAB Group company
> Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
> KDAB - The Qt, C++ and OpenGL Experts
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2021-07-09 01:49:24