Article View: comp.std.c++
Article #1153Re: Zero-length structures and pointer comparisons
From: Jim Adcock
Date: Thu, 24 Dec 1992 00:58
Date: Thu, 24 Dec 1992 00:58
16 lines
1438 bytes
1438 bytes
In article <9235622.25712@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes: |A ptrcmp that always returned 0 would be useless, IMHO. Such an implementation would allow people to write code that does the ptrcmp. If the ptrcmp is zero, then the pointers could be compared. If the pointers didn't compare equal, then the invoking code would know that this machine doesn't support ptrcmp, and then the invoking code would fall back on a secondary, possibly slightly slower [but more globally implementable] approach -- such as comparing object surrogates. Thus such a ptrcmp would allow "optimal" performance on those systems that can reasonably implement a total ordering, and would allow near optimal performance on those machines that can't reasonably implement a total ordering. Rather than insisting that those systems that can't reasonably implement ptrcmp do so anyway, or alternately not implement it at all, leading to "portable" code that isn't in practice portable anyway.
Technical Details
Message-ID:
<1992Dec24.005848.1629@microsoft.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!microsoft!hexnut!jimadReferences:
<BzCG7K.2sG@frumious.uucp> <1992Dec18.192202.17023@ucc.su.OZ.AU> <9235622.25712@mulga.cs.mu.OZ.AU>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++ Path: arc1-ca.pugleaf.net!sparky!uunet!microsoft!hexnut!jimad From: jimad@microsoft.com (Jim Adcock) Subject: Re: Zero-length structures and pointer comparisons Message-ID: <1992Dec24.005848.1629@microsoft.com> Date: 24 Dec 92 00:58:48 GMT Organization: Microsoft Corporation References: <BzCG7K.2sG@frumious.uucp> <1992Dec18.192202.17023@ucc.su.OZ.AU> <9235622.25712@mulga.cs.mu.OZ.AU> Lines: 17