[ub] Justification for < not being a total order on pointers?
Jens Maurer
Jens.Maurer at gmx.net
Thu Oct 10 08:43:39 CEST 2013
On 10/10/2013 08:21 AM, Lawrence Crowl wrote:
> The total ordering can be significantly more complex than today whenever
> two segments can refer to the same memory. In general, it may require
> an OS query to the virtual table to provide the ordering, which is likely to
> be way more expensive than anyone would like.
Why should < reflect such virtual memory hackery at all?
Note that comparing pointers to different complete objects yields
unspecified results anyway (see 5.9 expr.rel).
I don't think there is a way to tell C++ that I've got two pointers
that look like pointing to different objects (= different regions of
storage), yet are the same when looking through the VM layers.
Such a setup should cause all kinds of aliasing issues, where < is the
least of the problems.
Thanks,
Jens
More information about the ub
mailing list