220 4424 <CAFk2RUbbkVg5+r47UfkyD0-WTGm9=oi4OKNrX+V8--wN+74J+A@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Ville Voutilainen <ville.voutilainen@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: Wed, 15 May 2013 11:48:32 +0300
Lines: 140
Approved: news@gmane.org
Message-ID: <CAFk2RUbbkVg5+r47UfkyD0-WTGm9=oi4OKNrX+V8--wN+74J+A@mail.gmail.com>
References: <CAGg_6+NTws7QyEAsEUd308yx4LncpD_r6x4yJEJy5RN2w6v2Hw@mail.gmail.com>
	<CAGg_6+PTyNK6rTAdC3NKLOnLR3g0WfyqgNKmHz-9edMOdjnVNA@mail.gmail.com>
	<CAFk2RUZw2wyMrbaRpYzWApeRNp2kx0MK7wurbD09P+D5r_As9w@mail.gmail.com>
	<CAFk2RUbdNQi+qBL2H55nZcZT++t26jREW_2r24yHQq2LcdrQnQ@mail.gmail.com>
	<CAGqM8fY=iZmwKBjLvqimn5d3pAtvLQgKbknPkG6WSYFZ2_OfZw@mail.gmail.com>
	<CAPXezF-kXv6M62uuYBYspcRYg1JwUiSOx04ooeGH-z55APHbGA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=089e01229c308d9e6904dcbdd018
X-Trace: ger.gmane.org 1368607723 26462 80.91.229.3 (15 May 2013 08:48:43 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 15 May 2013 08:48:43 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRBY4XZWGAKGQEBGT4A6A@isocpp.org Wed May 15 10:48:43 2013
Return-path: <std-proposals+bncBC5JHI7A7ALRBY4XZWGAKGQEBGT4A6A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ie0-f197.google.com ([209.85.223.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBY4XZWGAKGQEBGT4A6A@isocpp.org>)
	id 1UcXO0-0002CI-Mm
	for gclcip-std-proposals@m.gmane.org; Wed, 15 May 2013 10:48:37 +0200
Original-Received: by mail-ie0-f197.google.com with SMTP id 16sf5535691iea.0
        for <gclcip-std-proposals@m.gmane.org>; Wed, 15 May 2013 01:48:35 -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:mime-version
         :x-received:in-reply-to:references:date:message-id:subject:from: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=paX+gaUckgnlSwpUoCNU1mug5UtKEsnkp2euIYBOfyw=;
        b=HwLt+Oiut3dVDWD74iCVz+XI0mLBfLBIvBaNxTnKwoFdF3PSgpndhBaY2/LBsJOSdM
         s7e+KnqIsl9XhNAx3z33Y20Urm/D1IlF9gLfjKMjMvDF61DpFswP9RPzpbzSOO+dVOi2
         sws6zVWwRzuf5mRI8OxnNf0BpZ+mEVkaE4Az5V2nlyDiXoTb6bTdJ/avN+MSrxkczRK8
         YXAg7a7Q8fRmkDivoztEG8DG930io6r5G+E5t27uXxFvprgBZfph7+wkbb6dwTCEdQeI
         dEKQ/fG18KPsNjCS+g+ihhuItHXwX7WGv2MFUbALCX9by0ZWuBtC3IA+r/5lD3oebAWe
  
X-Received: by 10.182.120.228 with SMTP id lf4mr10901804obb.20.1368607715513;
        Wed, 15 May 2013 01:48:35 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.86.99 with SMTP id o3ls123221obz.97.gmail; Wed, 15 May
 2013 01:48:32 -0700 (PDT)
X-Received: by 10.182.60.136 with SMTP id h8mr16548351obr.47.1368607712843;
        Wed, 15 May 2013 01:48:32 -0700 (PDT)
Original-Received: from mail-oa0-f52.google.com (mail-oa0-f52.google.com [209.85.219.52])
        by mx.google.com with ESMTPS id rm9si1108654oeb.2.2013.05.15.01.48.32
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 15 May 2013 01:48:32 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 209.85.219.52 as permitted sender) client-ip=209.85.219.52;
Original-Received: by mail-oa0-f52.google.com with SMTP id h1so1865368oag.11
        for <std-proposals@isocpp.org>; Wed, 15 May 2013 01:48:32 -0700 (PDT)
X-Received: by 10.60.33.105 with SMTP id q9mr18511598oei.54.1368607712712;
 Wed, 15 May 2013 01:48:32 -0700 (PDT)
Original-Received: by 10.76.10.130 with HTTP; Wed, 15 May 2013 01:48:32 -0700 (PDT)
In-Reply-To: <CAPXezF-kXv6M62uuYBYspcRYg1JwUiSOx04ooeGH-z55APHbGA@mail.gmail.com>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of ville.voutilainen@gmail.com designates 209.85.219.52 as permitted
 sender) smtp.mail=ville.voutilainen@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:4424
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4424>

--089e01229c308d9e6904dcbdd018
Content-Type: text/plain; charset=ISO-8859-1

On 8 May 2013 01:29, Fernando Cacciola <fernando.cacciola@gmail.com> wrote:

> On Tue, May 7, 2013 at 7:14 PM, Lawrence Crowl <crowl@googlers.com> wrote:
>
>>
>> The naming is unfortunate, but the distinction between value ordering
>> and representation ordering is fundamental and deserves explicit
>> recognition in the language.  Right now, we have the convention that
>> value ordering is spelled operator< and representation ordering is
>> spelled std::less.
>>
>> Well, I was not aware that this was, or is, the intention, but I do agree
> with the distinction between the two types of orderings, specially in the
> case where there is no value ordering at all, but there (always) is some
> valid representation ordering for the sake of lookups. I often resort to
> constructing a (large enough) integer out of the bits of all fields just
> for that.
>
> I also very much like the idea of using < and std::less for one and the
> other.
>
> I also agree that, for the sake of associative lookup, defininng
> std::greater in terms of std::less is exactly right, regardless of how
> operator > would be defined (so I'm saying I've got it wrong all along
> thinking that > in terms of < is a good idea because that's how the std
> functors work)
>
> Having said all that, I now feel that the appropriate resolution for
> std::optional<> is to implement all operators in terms of the underlying
> type. The rest of the library should IMO do the same, but if it can't be
> changed, let's at least avoid perpetuating the mistake.
>
>
>
I did a little bit of further homework on the matter. boost::tuple does NOT
synthesize the comparison operators,
but rather calls the operator of the underlying type. The existing practice
isn't consistent. ;)

This needs at least an overview paper. I'd be willing to entertain the idea
to propose making all relational
operators, including tuple and containers, to not synthesize. I suppose the
fallback plans are synthesize-for-all
and deliberately-inconsistent, not necessarily in any preference order.

In addition to that, tuples and containers would seemingly need std::less
specializations. That's actually somewhat separate.

Fernando, Tony, would you be interested in coauthoring?

-- 

--- 
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.



--089e01229c308d9e6904dcbdd018
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On 8 May 2013 01:29, Fernando Cacciola <span dir=3D"ltr">&lt;<a hre=
f=3D"mailto:fernando.cacciola@gmail.com" target=3D"_blank">fernando.cacciol=
a@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_extra">=
<div class=3D"gmail_quote"><div class=3D"im">On Tue, May 7, 2013 at 7:14 PM=
, Lawrence Crowl <span dir=3D"ltr">&lt;<a href=3D"mailto:crowl@googlers.com=
" target=3D"_blank">crowl@googlers.com</a>&gt;</span> wrote:<br>


<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><br>The naming is unfortunate, but the disti=
nction between value ordering<br>
and representation ordering is fundamental and deserves explicit<br>
recognition in the language. =A0Right now, we have the convention that<br>
value ordering is spelled operator&lt; and representation ordering is<br>
spelled std::less.<br>
<br></blockquote></div><div>Well, I was not aware that this was, or is, the=
 intention, but I do agree with the distinction between the two types of or=
derings, specially in the case where there is no value ordering at all, but=
 there (always) is some valid representation ordering for the sake of looku=
ps. I often resort to constructing a (large enough) integer out of the bits=
 of all fields just for that.<br>


<br></div><div>I also very much like the idea of using &lt; and std::less f=
or one and the other.<br><br></div><div>I also agree that, for the sake of =
associative lookup, defininng std::greater in terms of std::less is exactly=
 right, regardless of how operator &gt; would be defined (so I&#39;m saying=
 I&#39;ve got it wrong all along thinking that &gt; in terms of &lt; is a g=
ood idea because that&#39;s how the std functors work)<br>


</div><div><br></div><div>Having said all that, I now feel that the appropr=
iate resolution for std::optional&lt;&gt; is to implement all operators in =
terms of the underlying type. The rest of the library should IMO do the sam=
e, but if it can&#39;t be changed, let&#39;s at least avoid perpetuating th=
e mistake.<br>


</div><div><br><br></div></div></div></div></blockquote><div><br></div><div=
>I did a little bit of further homework on the matter. boost::tuple does NO=
T synthesize the comparison operators,<br>but rather calls the operator of =
the underlying type. The existing practice isn&#39;t consistent. ;)<br>
<br></div><div>This needs at least an overview paper. I&#39;d be willing to=
 entertain the idea to propose making all relational<br>operators, includin=
g tuple and containers, to not synthesize. I suppose the fallback plans are=
 synthesize-for-all<br>
and deliberately-inconsistent, not necessarily in any preference order.<br>=
<br></div></div>In addition to that, tuples and containers would seemingly =
need std::less specializations. That&#39;s actually somewhat separate.<br>
<br></div><div class=3D"gmail_extra">Fernando, Tony, would you be intereste=
d in coauthoring?<br></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 />

--089e01229c308d9e6904dcbdd018--

.
