C++ Logo

sg12

Advanced search

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

From: Daniel Krügler <daniel.kruegler_at_[hidden]>
Date: Tue, 27 Aug 2013 21:23:16 +0200
2013/8/27 Jeffrey Yasskin <jyasskin_at_[hidden]>:
> I think that particular implementation is forbidden. The rule in
> [expr.reinterpret.cast]p4 is: "A pointer can be explicitly converted
> to any integral type large enough to hold it. The mapping function is
> implementation-defined." Since it's a "function", it has to map a
> domain value to only one value in the range.

I'm not sure that the standard is very clear here in which sense the
term "function" or "mapping function" can be interpreted. One could
argue that the language is (intentionally?) fuzzy here.

- Daniel

Received on 2013-08-27 21:23:16