C++ Logo

std-discussion

Advanced search

Re: Pointer comparison with operators vs function objects

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 15 Sep 2025 22:42:34 -0700
On Monday, 15 September 2025 22:32:21 Pacific Daylight Time Nate Eldredge
wrote:
> If there is a proposal is to make `<` match std::less on *function* pointers
> only, while keeping its existing semantics on *data* pointers, then indeed
> I don't see any particular difficulties with that, except that the
> inconsistency between the two might be counterintuitive.

I also don't see any difficulty. However, I don't see any benefit in doing so,
because there is no capability or performance gain over what we already have.

Yongwei Wu's latest email is discussing reducing incidence of UB.
Unfortunately, it falls into the trap of declaring that UB should not be used
for optimisations and therefore all/most UB can be made defined so code is
automatically safer.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Platform & System Engineering

Received on 2025-09-16 05:42:40