220 4217 <CAPXezF9duRWCYnWr2DqfFjim6w2MPc3TMQOR+pJ4tryUnAeOtQ@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Fernando Cacciola <fernando.cacciola@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Fixing Standard Library relational operators (was:
 Re: optional Rev.4 (N3672): What was the rationale to remove
 !=, >=, ...)
Date: Thu, 2 May 2013 18:24:51 -0300
Lines: 139
Approved: news@gmane.org
Message-ID: <CAPXezF9duRWCYnWr2DqfFjim6w2MPc3TMQOR+pJ4tryUnAeOtQ@mail.gmail.com>
References: <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=001a11c33e24c3b1eb04dbc2dfb6
X-Trace: ger.gmane.org 1367529934 14522 80.91.229.3 (2 May 2013 21:25:34 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 2 May 2013 21:25:34 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCOPV7FAXQPRBTFTROGAKGQEN6HFG6I@isocpp.org Thu May 02 23:25:35 2013
Return-path: <std-proposals+bncBCOPV7FAXQPRBTFTROGAKGQEN6HFG6I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f199.google.com ([209.85.217.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCOPV7FAXQPRBTFTROGAKGQEN6HFG6I@isocpp.org>)
	id 1UY10P-0002O8-NG
	for gclcip-std-proposals@m.gmane.org; Thu, 02 May 2013 23:25:33 +0200
Original-Received: by mail-lb0-f199.google.com with SMTP id t11sf1531302lbd.2
        for <gclcip-std-proposals@m.gmane.org>; Thu, 02 May 2013 14:25:33 -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:in-reply-to:references: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=h5pfI3hK5bPEuSDplcJ/B8hUa8Xyiw8080Z5kf1WTgM=;
        b=nkxLGE61Z8tBZtBmulcExuat/PsZmg0pAhGX+IoSQaMCrrzlhmGhH1PTRJLH2yHPxj
         qWHHGJv9O98Bujf72YuS3w/D5XCpYYF28RFbwhpqq+cSi0tkCrFd7AjZxb+JejdcWVGF
         8AfuYhwrh/m9IzlqGnHAADHIGTuCKgY2O42Qn11tKT6KCy51/LnGVTO2fXhg3jGjTOsV
         N7BWSwIiBUOAKLfHsswBzF//glCXpw0nsI1vNeXCNVoATRkW6PgtIh7aIyGgtq1HvJBf
         p2COH3Xr8T8kXuEHWrPiNAcP5XaTL5eIX/JpQJHSpOn1IcCJ7wPQsQOZ78B+cSZqoTF4
  
X-Received: by 10.152.6.69 with SMTP id y5mr8580138lay.1.1367529933128;
        Thu, 02 May 2013 14:25:33 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.19.232 with SMTP id i8ls150032lae.60.gmail; Thu, 02 May
 2013 14:25:31 -0700 (PDT)
X-Received: by 10.112.146.34 with SMTP id sz2mr3304028lbb.4.1367529931301;
        Thu, 02 May 2013 14:25:31 -0700 (PDT)
Original-Received: from mail-la0-x22b.google.com (mail-la0-x22b.google.com [2a00:1450:4010:c03::22b])
        by mx.google.com with ESMTPS id l3si1267615lag.21.2013.05.02.14.25.31
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Thu, 02 May 2013 14:25:31 -0700 (PDT)
Received-SPF: pass (google.com: domain of fernando.cacciola@gmail.com designates 2a00:1450:4010:c03::22b as permitted sender) client-ip=2a00:1450:4010:c03::22b;
Original-Received: by mail-la0-f43.google.com with SMTP id ea20so976961lab.30
        for <std-proposals@isocpp.org>; Thu, 02 May 2013 14:25:31 -0700 (PDT)
X-Received: by 10.112.72.97 with SMTP id c1mr3319200lbv.96.1367529931123; Thu,
 02 May 2013 14:25:31 -0700 (PDT)
Original-Received: by 10.114.20.106 with HTTP; Thu, 2 May 2013 14:24:51 -0700 (PDT)
In-Reply-To: <CAGg_6+NTws7QyEAsEUd308yx4LncpD_r6x4yJEJy5RN2w6v2Hw@mail.gmail.com>
X-Original-Sender: fernando.cacciola@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of fernando.cacciola@gmail.com designates 2a00:1450:4010:c03::22b as
 permitted sender) smtp.mail=fernando.cacciola@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:4217
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4217>

--001a11c33e24c3b1eb04dbc2dfb6
Content-Type: text/plain; charset=ISO-8859-1

On Thu, May 2, 2013 at 6:19 PM, Nevin Liber <nevin@eviloverlord.com> wrote:

> 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
>

Actually, if we are going to fix the *entire* library, then we *could*
chose to have all operators boild down to the underlying component(s)

IIRC, the main reason for not doing so is consistency across the SCL.



-- 
Fernando Cacciola
SciSoft Consulting, Founder
http://www.scisoft-consulting.com

-- 

--- 
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.



--001a11c33e24c3b1eb04dbc2dfb6
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On T=
hu, May 2, 2013 at 6:19 PM, Nevin Liber <span dir=3D"ltr">&lt;<a href=3D"ma=
ilto:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.com</a>&g=
t;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">On 2 May 2013 16:05, Ville Voutilainen <span=
 dir=3D"ltr">&lt;<a href=3D"mailto: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"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-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<span class=3D"HOEnZb"><font color=3D"#888888"><br></font></span></div>

</div></blockquote><div><br></div><div>Actually, if we are going to fix the=
 *entire* library, then we *could* chose to have all operators boild down t=
o the underlying component(s)<br><br></div><div>IIRC, the main reason for n=
ot doing so is consistency across the SCL.<br>

<br></div><div>=A0<br clear=3D"all"></div></div><br>-- <br>Fernando Cacciol=
a<br>SciSoft Consulting, Founder<br><a href=3D"http://www.scisoft-consultin=
g.com">http://www.scisoft-consulting.com</a>
</div></div>

<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 />

--001a11c33e24c3b1eb04dbc2dfb6--

.
