C++ Logo

SG12

Advanced search

Subject: Re: [ub] Justification for < not being a total order on pointers?
From: Gabriel Dos Reis (gdr_at_[hidden])
Date: 2013-10-17 10:19:09


Nevin Liber <nevin_at_[hidden]> writes:

| But, even if segmented architectures, unlikely though it is, do come back, the
| ordering problem still has to be addressed, as std::less<T*> is required to
| totally order pointers.  I just want operator< to be an alternate spelling for
| that property.

I will repeat this again: std::less<T*> is absolutely not a problem,
because this

      return intptr_t(p) < intptr_t(q);

is valid and portable definition that requires no other special handling.

-- Gaby


SG12 list run by herb.sutter at gmail.com