C++ Logo

SG12

Advanced search

Subject: Re: [ub] Justification for < not being a total order on pointers?
From: Daniel Krügler (daniel.kruegler_at_[hidden])
Date: 2013-08-27 14:23:16


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


SG12 list run by herb.sutter at gmail.com