[ub] C provenance semantics proposal

Gabriel Dos Reis gdr at microsoft.com
Thu Apr 4 22:58:02 CEST 2019


[Jens]
| It seems to me that most of the introductory examples have clear
| answers in current C++.  In particular:
| 
| — If one pointer represents the address of a complete object, and another
| pointer represents the address
|   one past the last element of a different complete object, the result of the
| comparison is unspecified.
| 
| The proposal in N2362 seems to make such a comparison yield "true".
| 
| I actually like our current rule: never ever compare / subtract pointers
| to different complete objects.  If you must compare, use std::less.

+1.

-- Gaby



More information about the ub mailing list