C++ Logo

std-discussion

Advanced search

Re: Hostile implementation of strict total order of pointers

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 23 Jul 2023 22:00:50 -0700
On Sunday, 23 July 2023 09:57:50 PDT Lénárd Szolnoki via Std-Discussion wrote:
> I don't think the standard rules out such an odd implementation, but I
> think it should.

Agreed. Either that or it should provide a function for "does this pointer
point to somewhere in this array". I think the cost of standardising the
std::less behaviour we want is less (no pun intended), because probably it's a
no-op in terms of any extant implementation.

It can be as simple as "given two pointer P and Q pointing to the same array
and R pointing to another, std::less will return lesser than R for both P and
Q or greater than R for both"

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-07-24 05:00:57