220 4425 <CAPXezF9fYSRtR2pExe=25JpUGvsG_UK9bZFMHcm_HGfCj-hr_w@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: Wed, 15 May 2013 09:20:32 -0300
Lines: 192
Approved: news@gmane.org
Message-ID: <CAPXezF9fYSRtR2pExe=25JpUGvsG_UK9bZFMHcm_HGfCj-hr_w@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> <CAFk2RUbbkVg5+r47UfkyD0-WTGm9=oi4OKNrX+V8--wN+74J+A@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=047d7b3441681edd2004dcc0c93b
X-Trace: ger.gmane.org 1368620475 32661 80.91.229.3 (15 May 2013 12:21:15 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 15 May 2013 12:21:15 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCOPV7FAXQPRBOX3ZWGAKGQELZINXPQ@isocpp.org Wed May 15 14:21:16 2013
Return-path: <std-proposals+bncBCOPV7FAXQPRBOX3ZWGAKGQELZINXPQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f198.google.com ([209.85.217.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCOPV7FAXQPRBOX3ZWGAKGQELZINXPQ@isocpp.org>)
	id 1Ucahn-0000pa-UQ
	for gclcip-std-proposals@m.gmane.org; Wed, 15 May 2013 14:21:15 +0200
Original-Received: by mail-lb0-f198.google.com with SMTP id r10sf1574424lbi.9
        for <gclcip-std-proposals@m.gmane.org>; Wed, 15 May 2013 05:21:15 -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=LkHvlAfD5JAs1M3NUMh2Pf8MdjFtUUE0T1OFHc7qPlk=;
        b=R5cEIoIWNpNbEBKAv5f5U7nwIFCpj8I8X+EF4HKBi1glKzMRe4FaexOCnyh32zS93q
         ULKlMopcDCVzoEcmBxflHnTjCKWe5ICWKwbS8n+aDp02OxkymwDZesEN92qCda9J0Cf0
         IFrGn1yESn3KVST92hZPGaroG4FmhauPcUFhc+1jC27oUquN4xqgkYRDmMlKqR7T+jhn
         YHpf88T5sKjTKdA5Hf6QXjDLthEQjsq7YHMCLFWtWNwfW8zcGAcbGR4NabymYcrNxO3B
         mqh+LEjKn2F2+WNgrae5Ss3O6C1r6BrYWE4EDQ4rfrYJzmmjRJm8iBGczEQqJ4p1WUVm
  
X-Received: by 10.152.26.38 with SMTP id i6mr10847972lag.9.1368620475266;
        Wed, 15 May 2013 05:21:15 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.27.230 with SMTP id w6ls49468lag.68.gmail; Wed, 15 May
 2013 05:21:13 -0700 (PDT)
X-Received: by 10.152.88.40 with SMTP id bd8mr18004975lab.9.1368620473622;
        Wed, 15 May 2013 05:21:13 -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 nr2si990598lbb.9.2013.05.15.05.21.13
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 15 May 2013 05:21:13 -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 ez20so479101lab.2
        for <std-proposals@isocpp.org>; Wed, 15 May 2013 05:21:13 -0700 (PDT)
X-Received: by 10.112.147.170 with SMTP id tl10mr17183362lbb.100.1368620472915;
 Wed, 15 May 2013 05:21:12 -0700 (PDT)
Original-Received: by 10.114.80.164 with HTTP; Wed, 15 May 2013 05:20:32 -0700 (PDT)
In-Reply-To: <CAFk2RUbbkVg5+r47UfkyD0-WTGm9=oi4OKNrX+V8--wN+74J+A@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:4425
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4425>

--047d7b3441681edd2004dcc0c93b
Content-Type: text/plain; charset=ISO-8859-1

On Wed, May 15, 2013 at 5:48 AM, Ville Voutilainen <
ville.voutilainen@gmail.com> wrote:

>
>
>
> 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?
>

Now that I am much more convinced that the right approach is to not
synthesize (consistently across the whole library), I would definitely like
to coauthor such a paper!


Best


-- 
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.



--047d7b3441681edd2004dcc0c93b
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 W=
ed, May 15, 2013 at 5:48 AM, Ville Voutilainen <span dir=3D"ltr">&lt;<a hre=
f=3D"mailto:ville.voutilainen@gmail.com" target=3D"_blank">ville.voutilaine=
n@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"><br><div class=3D"gmail_ext=
ra"><br><br><div class=3D"gmail_quote"><div><div class=3D"h5">On 8 May 2013=
 01:29, Fernando Cacciola <span dir=3D"ltr">&lt;<a href=3D"mailto:fernando.=
cacciola@gmail.com" target=3D"_blank">fernando.cacciola@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>On Tue, May 7, 2013 at 7:14 PM, Lawrence Cr=
owl <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></di=
v></div><div>I did a little bit of further homework on the matter. boost::t=
uple does NOT 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></blockquote><div><br></div><div>Now that =
I am much more convinced that the right approach is to not synthesize (cons=
istently across the whole library), I would definitely like to coauthor suc=
h a paper!<br>

<br><br></div><div>Best</div></div><br clear=3D"all"><br>-- <br>Fernando Ca=
cciola<br>SciSoft Consulting, Founder<br><a href=3D"http://www.scisoft-cons=
ulting.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 />

--047d7b3441681edd2004dcc0c93b--

.
