🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1554

STL operators != > <= >=

#1554
From: mfinney
Date: Thu, 03 Aug 1995 05:31
25 lines
1512 bytes
In the 28 April 1995 Draft Standard (which I was only able to download last week)
section 20.2.1 says that the STL portion of the Standard Library will define
operator!=(), operator>(), operator<=() and operator>=() in terms of operator=()
and operator<().

This breaks my code!  And NOT in a fixable fashion!

In particular, I have a PartialOrder class (which is a base class of LinearOrder)
and the assumption that these operators can so be defined is ONLY valid for
linear orders.  In a partial order "<" is equivalent to "=", ">" or "uncomparable"
which is not at all the same thing as "=" or ">".

It is extremely convenient to use the same operators in the PartialOrder class
as in the LinearOrder class (as, indeed, they really ARE the same operators)
and inclusion of the template definition of these operators conflicts with my
definitions -- which are NOT allowed to take the convenient shortcuts assumed
by the STL authors.

Is there any standard way to disable this "feature" of the STL portion of the
library?  If not, this essentially means that I cannot use the STL abilities which
are, in general, very nice.

HELP!

Michael Lee Finney
Technical Details
Message-ID: <3vpmv5$4t7@mujibur.inmind.com>
Path: arc1-ca.pugleaf.net!mujibur.inmind.com!usenet

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!mujibur.inmind.com!usenet
From: mfinney@inmind.com
Newsgroups: comp.std.c++
Subject: STL operators != > <= >=
Date: 3 Aug 1995 05:31:17 GMT
Organization: In Mind, Inc.
Message-ID: <3vpmv5$4t7@mujibur.inmind.com>
Reply-To: mfinney@inmind.com
NNTP-Posting-Host: finneyman.inmind.com
X-Newsreader: IBM NewsReader/2 v1.2