C++ Logo


Advanced search

Re: [ub] Justification for < not being a total order on pointers?

From: Lawrence Crowl <Lawrence_at_[hidden]>
Date: Sun, 27 Oct 2013 22:11:14 -0700
On 10/16/13, Stephan T. Lavavej <stl_at_[hidden]> wrote:
> Yep - I intended for less<void> to simply be op< in functor form, with no
> additional semantics.
> Separately, I believe that the Core Language should simply recognize the
> fact that all machines these days have a flat memory model.

I think this would be a mistake. Capability-based machines are more
secure, and security is growing in importance. It is not clear to me that
we can assume that *all* pointers will be totally ordered. I think we can
assume that all pointers from a single allocation domain are totally ordered.
(This would mean, for instance, that you could compare two pointers from
the primary heap, but you could not compare a heap pointer with a stack

> (Two's complement and 8-bit bytes would be nice too.)

We already have two's complement in the intN_t types.

Asking for 8-bit bytes seems a bit harder.

Lawrence Crowl

Received on 2013-10-28 06:18:50