From -2127376245293681822
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,e94695845965b249
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1992-10-17 04:31:58 PST
Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!att!allegra!alice!ark
From: ark@alice.att.com (Andrew Koenig)
Newsgroups: comp.std.c++
Subject: Re: Zero-length structures and pointer comparisons
Message-ID: <23915@alice.att.com>
Date: 17 Oct 92 15:56:32 GMT
Article-I.D.: alice.23915
References: <9225302.22791@mulga.cs.mu.OZ.AU> <4945@holden.lulea.trab.se> <1992Sep10.094957.23588@jyu.fi> <1992Oct16.234851.28948@microsoft.com>
Reply-To: ark@alice.UUCP ()
Organization: AT&T Bell Laboratories, Murray Hill NJ
Lines: 20

In article <1992Oct16.234851.28948@microsoft.com> jimad@microsoft.com (Jim Adcock) writes:

> But in any case, at least my PC compiler (Large Model)
> performs == and != comparisons based both on the segment and offset parts.
> Its the ordered comparisons > < >= <= where only the offset part is compared.
> Thus == != work for all ptrs.  > < >= <= only work within an array.

> Which is as it should be.

This is far from clear.

For example, if a type T has a < operator defined that is actually a strong
total order relation, that makes it possible to store T objects efficiently
in a variety of order-based data structures such as M,N-trees, etc.
There are many applications for such structures.  For example, one might make
the constructor and destructor for class T use such a structure to keep
track of all the T objects in the universe, and so on.
-- 
				--Andrew Koenig
				  ark@europa.att.com


