C++ Logo


Advanced search

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

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Sat, 10 Jul 2021 12:39:48 +0200
Il 10/07/21 00:12, Jens Maurer via Std-Proposals ha scritto:
> So, this paper made (T*)anything < nullptr
> ill-formed, because nullptr cannot ever point to the
> same object as the other operand, so this is always
> undefined behavior. Flagging this at compile-time is
> a good idea. Plus it's consistent with C, as explained
> here:
> http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#583

By the way, this reminded me that C is also in the process of
introducing nullptr:

> http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2692.pdf

OP may want therefore to also target SG22.

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

Received on 2021-07-10 05:39:57