From -2710875960799645457
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,e94695845965b249
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1992-12-12 14:05:58 PST
Path: sparky!uunet!wupost!usc!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!news.lth.se!dag
From: dag@bellman.control.lth.se (Dag Bruck)
Newsgroups: comp.std.c++
Subject: Re: Zero-length structures and pointer comparisons
Message-ID: <1992Dec12.215255.29154@lth.se>
Date: 12 Dec 92 21:52:55 GMT
References: <1992Dec8.103218.27689@lth.se> <9234423.15066@mulga.cs.mu.OZ.AU> <1992Dec9.133956.29659@lth.se> <1992Dec12.155417.2628@ucc.su.OZ.AU>
Sender: news@lth.se
Organization: Department of Automatic Control, Lund, Sweden
Lines: 18

In <comp.std.c++> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
>In article <...> dag@seldon.control.lth.se (Dag Bruck) writes:
>>
>>Suggested semantics: for any pointers p and q:
>>
>>	p == q   <=>   ptrcmp(p,q) == 0
>
>	Are you SURE you need this? Why should == and ptrcmp
>be in any way related?

Because it would be very counter-intuitive, hence error-prone, if that
equality did not hold.

I also support the additional rule suggested by Jerry Schwarz:

	if (p < q) is defined:

	p < q   <=>   ptrcmp(p,q) < 0


