220 4215 <CAGg_6+NTws7QyEAsEUd308yx4LncpD_r6x4yJEJy5RN2w6v2Hw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Nevin Liber <nevin@eviloverlord.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Fixing Standard Library relational operators (was: 
 Re: optional Rev.4 (N3672): What was the rationale to remove !=, >=, ...)
Date: Thu, 2 May 2013 16:19:35 -0500
Lines: 103
Approved: news@gmane.org
Message-ID: <CAGg_6+NTws7QyEAsEUd308yx4LncpD_r6x4yJEJy5RN2w6v2Hw@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=00151757716404d22204dbc2cdd6
X-Trace: ger.gmane.org 1367529632 11189 80.91.229.3 (2 May 2013 21:20:32 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 2 May 2013 21:20:32 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCE35H5S6IDBBGFRROGAKGQERWKLMHQ@isocpp.org Thu May 02 23:20:31 2013
Return-path: <std-proposals+bncBCE35H5S6IDBBGFRROGAKGQERWKLMHQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-gh0-f200.google.com ([209.85.160.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCE35H5S6IDBBGFRROGAKGQERWKLMHQ@isocpp.org>)
	id 1UY0vU-0006AV-2a
	for gclcip-std-proposals@m.gmane.org; Thu, 02 May 2013 23:20:28 +0200
Original-Received: by mail-gh0-f200.google.com with SMTP id 10sf1486311ghy.7
        for <gclcip-std-proposals@m.gmane.org>; Thu, 02 May 2013 14:20:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-received:x-beenthere:x-received:received-spf:x-received
         :mime-version:sender:from:date:message-id:subject:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-google-group-id:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe:content-type;
        bh=LYGSJftZIn/C3/bx9D8tQ/Rbx+nE9ck8LTMjFKkPrv0=;
        b=MQ7HOfB1xasCLuXlIGqR5Fc/bGKXAczq+cWnRFYU8yygOe+A4KpzjweyY4D4xYpjlV
         qbU/XnaQaE4qWfjY//iQ5USDLhpifyrxr2teJ5sKsyM/OlhSxTF+k7+SEs/KnhIZJPVi
         0Ru4hVfd7jUzyNmMZjEENfyKH1LVgpkSu6PNOdFJpX0P7WJoFcJ7PfvVdIY9/E3+mqCT
         maOitrUmtA9I3/8+nbIqItlpf5kdx4XS+ME4vFHCelNl2YziK0DdmYXjW2V6nOdE2uTX
         HsTWd4DugJdUY0Op1Ox6ZQR+s0aoTxGaFnQgdqjt0KtpxYFO0JHhPkIcoLECpWz/ujXj
         HvMg==
X-Received: by 10.236.183.98 with SMTP id p62mr6678040yhm.3.1367529627123;
        Thu, 02 May 2013 14:20:27 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.47.48 with SMTP id a16ls891870qen.25.gmail; Thu, 02 May
 2013 14:20:17 -0700 (PDT)
X-Received: by 10.229.139.83 with SMTP id d19mr3464647qcu.100.1367529616983;
        Thu, 02 May 2013 14:20:16 -0700 (PDT)
Original-Received: from mail-qe0-f43.google.com (mail-qe0-f43.google.com [209.85.128.43])
        by mx.google.com with ESMTPS id t20si2540054qcw.146.2013.05.02.14.20.16
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Thu, 02 May 2013 14:20:16 -0700 (PDT)
Received-SPF: pass (google.com: domain of nliber@gmail.com designates 209.85.128.43 as permitted sender) client-ip=209.85.128.43;
Original-Received: by mail-qe0-f43.google.com with SMTP id 1so550132qec.2
        for <std-proposals@isocpp.org>; Thu, 02 May 2013 14:20:16 -0700 (PDT)
X-Received: by 10.229.61.40 with SMTP id r40mr3423536qch.81.1367529616606;
 Thu, 02 May 2013 14:20:16 -0700 (PDT)
Original-Sender: nliber@gmail.com
Original-Received: by 10.49.24.169 with HTTP; Thu, 2 May 2013 14:19:35 -0700 (PDT)
X-Original-Sender: nevin@eviloverlord.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of nliber@gmail.com designates 209.85.128.43 as permitted sender)
 smtp.mail=nliber@gmail.com;       dkim=pass header.i=@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:4215
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4215>

--00151757716404d22204dbc2cdd6
Content-Type: text/plain; charset=ISO-8859-1

On 2 May 2013 16:05, Ville Voutilainen <ville.voutilainen@gmail.com> wrote:

>
>
> Precisely. And I want to restore that state, and add a std::less
> specialization, and do anything more elaborate
> separately, _if at all_. However, regarding std::less, we need to look at
> whether we want to do a specialization
> of it for pair/tuple too, I guess. tuple<T*> will not work right as an
> ordered associative container key, if I
> understand correctly.
>

If we are going for consistency and correctness among everything in the
standard library, is this correct solution:

operator< should be implemented in terms of operator< of the underlying
component(s)
operator== should be implemented in terms of operator== of the underlying
component(s)
std::less should be implemented in terms of std::less of the underlying
component(s)
std::equal_to should be implemented in terms of std::equal_to of the
underlying component(s)

operator>, operator<=, operator>= should be written in terms of operator<
operator!= should be written in terms of operator==
std::greater, std::less_equal, std::greater_equal should be written in
terms of std::less
std::not_equal_to should be written in terms of std::equal_to
-- 
 Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  (847) 691-1404

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.



--00151757716404d22204dbc2cdd6
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 2 May 2013 16:05, Ville Voutilainen <span dir=3D"ltr">&lt;<a href=3D"mai=
lto:ville.voutilainen@gmail.com" target=3D"_blank">ville.voutilainen@gmail.=
com</a>&gt;</span> wrote:<br><div class=3D"gmail_quote"><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex">

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te"><div>Precisely. And I want to restore that state, and add a std::less s=
pecialization, and do anything more elaborate<br>separately, _if at all_. H=
owever, regarding std::less, we need to look at whether we want to do a spe=
cialization<br>


of it for pair/tuple too, I guess. tuple&lt;T*&gt; will not work right as a=
n ordered associative container key, if I<br>understand correctly.<br></div=
></div></div></div></blockquote><div><br>If we are going for consistency an=
d correctness among everything in the standard library, is this correct sol=
ution:<br>

<br>operator&lt; should be implemented in terms of operator&lt; of the unde=
rlying component(s)<br>operator=3D=3D should be implemented in terms of ope=
rator=3D=3D of the underlying component(s)<br>std::less should be implement=
ed in terms of std::less of the underlying component(s)<br>

std::equal_to should be implemented in terms of std::equal_to of the underl=
ying component(s)<br><br>operator&gt;, operator&lt;=3D, operator&gt;=3D sho=
uld be written in terms of operator&lt;<br>operator!=3D should be written i=
n terms of operator=3D=3D<br>

std::greater, std::less_equal, std::greater_equal should be written in term=
s of std::less<br>std::not_equal_to should be written in terms of std::equa=
l_to<br></div></div>-- <br>=A0Nevin &quot;:-)&quot; Liber=A0 &lt;mailto:<a =
href=3D"mailto:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord=
..com</a>&gt;=A0 (847) 691-1404

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

--00151757716404d22204dbc2cdd6--

.
