C++ Logo

sg12

Advanced search

Re: [ub] C provenance semantics proposal

From: Gabriel Dos Reis <gdr_at_[hidden]>
Date: Wed, 10 Apr 2019 23:38:34 +0000
| -----Original Message-----
| From: ub-bounces_at_[hidden] <ub-bounces_at_[hidden]> On Behalf Of
| Jens Maurer
| Sent: Wednesday, April 10, 2019 4:34 PM
| To: WG21 UB study group SG12 <ub_at_[hidden]>
| Cc: cl-c-memory-object-model <cl-c-memory-object-model_at_[hidden]>;
| Jens Gustedt <jens.gustedt_at_[hidden]>
| Subject: Re: [ub] C provenance semantics proposal
|
| On 11/04/2019 00.35, David Vandevoorde wrote:
| >
| >
| >> On Apr 10, 2019, at 6:28 PM, Jens Maurer <Jens.Maurer_at_[hidden]>
| wrote:
| >>
| >> On 11/04/2019 00.06, Jens Gustedt wrote:
|
| >>> On Wed, 10 Apr 2019 23:40:37 +0200 Jens Maurer
| <Jens.Maurer_at_[hidden]>
| >>> wrote:
|
| >> So, again, why do you need to compare pointers to arbitrary
| >> objects?
| >
| > For hash tables where the keys are pointers to objects?
|
| Ok, what about binary trees where the keys are pointers to objects?
| (No worst-case situations, which might be important in some cases.)
|
| Seems like you want arbitrary equality comparisons if and only if
| you want arbitrary relational comparisons for the "containers"
| use case.

Hmm, I am not sure I see the equivalence.

I think it is undisputed that equality comparison of pointers (to arbitrary objects) has been part of C since day 1, and we have to support 1.
I don't see how that implies relational comparison between arbitrary pointers has to be supported. (Yes, I am aware programmers do things...)

-- Gaby

Received on 2019-04-11 01:38:37