220 18364 <CADvuK0KcVeFSu6ODD509thhAUO-_tHxw-De7dSSvV6U2N9PzNA@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: "Arthur O'Dwyer" <arthur.j.odwyer@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Core Language feature: Multiple assignments
 from multiple return values via tuple
Date: Tue, 2 Jun 2015 23:31:29 -0700
Lines: 160
Approved: news@gmane.org
Message-ID: <CADvuK0KcVeFSu6ODD509thhAUO-_tHxw-De7dSSvV6U2N9PzNA@mail.gmail.com>
References: <69a59613-6504-466a-9878-786653d6087f@isocpp.org>
	<6F892DDD-D1C2-446F-84E6-A2B81D096B2B@gmail.com>
	<9f3a42b5-befc-42e9-b739-654675eb4e02@isocpp.org>
	<1603866.meDQjFxuP6@tjmaciei-mobl4>
	<20ff0095-a634-40a7-8c01-3b302ece9bd3@isocpp.org>
	<556E77F4.5010004@wanadoo.fr>
	<3e68596f-1a33-481c-acfe-c230b212234c@isocpp.org>
	<556E9CB0.6090403@wanadoo.fr>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=f46d0438940d8f64e1051797353f
X-Trace: ger.gmane.org 1433313110 23902 80.91.229.3 (3 Jun 2015 06:31:50 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 3 Jun 2015 06:31:50 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDLZJYWNDQIMFPV2VMCRUBHXEHINU@isocpp.org Wed Jun 03 08:31:43 2015
Return-path: <std-proposals+bncBDLZJYWNDQIMFPV2VMCRUBHXEHINU@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wg0-f72.google.com ([74.125.82.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDLZJYWNDQIMFPV2VMCRUBHXEHINU@isocpp.org>)
	id 1Z02D5-0007JE-DL
	for gclcip-std-proposals@m.gmane.org; Wed, 03 Jun 2015 08:31:31 +0200
Original-Received: by wgme6 with SMTP id e6sf98212wgm.3
        for <gclcip-std-proposals@m.gmane.org>; Tue, 02 Jun 2015 23:31:30 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:content-type:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=bo1gWUB6OpVloWANo7ep60o7SHWBautjpIqdko2YxaM=;
        b=UtouJwOOiJh+0AS3EUhKUEW437ZZotAIXsuNC1yBhncjUZ3+K24Ej58FC9vbPYlyPL
         9PLDBgtpcEQQC6m6L36c5K0Kmsjbybqdhb902fB89H95YLl/cIoab/rheKvdBjKTXYzM
         mX0WdJqxa93f3psjPWlM35dZ5tIabv/fkfAU8zKaCE+ZsdE65wi3ss150iabzaZ5LpqE
         x1L1ahMYzQesrucqetpBtgmiLgrO84z21TGtyAxGfa1lr+Ua9SnawKgNqaszdzNGzEYX
         FFTx2MeoREPKJSIYAWuiI/cql4n+YdDE+NFzQt015EvOFPyciWRbCFfh9idjZpr6u6DY
         Hcdg==
X-Gm-Message-State: ALoCoQnPp0wth8PhTRltm6SLl8MtPhyjNzSg2c6zesRMBLVhlSaEnOlgvrjYD8Jql7urdtV7NKQm
X-Received: by 10.112.171.41 with SMTP id ar9mr29409593lbc.24.1433313090705;
        Tue, 02 Jun 2015 23:31:30 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.181.23.195 with SMTP id ic3ls1077547wid.49.canary; Tue, 02 Jun
 2015 23:31:29 -0700 (PDT)
X-Received: by 10.181.11.193 with SMTP id ek1mr38316686wid.15.1433313089743;
        Tue, 02 Jun 2015 23:31:29 -0700 (PDT)
Original-Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com. [2a00:1450:400c:c05::22a])
        by mx.google.com with ESMTPS id gd5si34958472wjb.115.2015.06.02.23.31.29
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 02 Jun 2015 23:31:29 -0700 (PDT)
Received-SPF: pass (google.com: domain of arthur.j.odwyer@gmail.com designates 2a00:1450:400c:c05::22a as permitted sender) client-ip=2a00:1450:400c:c05::22a;
Original-Received: by wifw1 with SMTP id w1so9130134wif.0
        for <std-proposals@isocpp.org>; Tue, 02 Jun 2015 23:31:29 -0700 (PDT)
X-Received: by 10.181.13.172 with SMTP id ez12mr1212662wid.91.1433313089642;
 Tue, 02 Jun 2015 23:31:29 -0700 (PDT)
Original-Received: by 10.27.6.3 with HTTP; Tue, 2 Jun 2015 23:31:29 -0700 (PDT)
In-Reply-To: <556E9CB0.6090403@wanadoo.fr>
X-Original-Sender: arthur.j.odwyer@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of arthur.j.odwyer@gmail.com designates 2a00:1450:400c:c05::22a as
 permitted sender) smtp.mail=arthur.j.odwyer@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=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>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:18364
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/18364>

--f46d0438940d8f64e1051797353f
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Tue, Jun 2, 2015 at 11:20 PM, Vicente J. Botet Escriba <
vicente.botet@wanadoo.fr> wrote:

>  Le 03/06/15 06:50, Nicol Bolas a =C3=A9crit :
>
>  On Tuesday, June 2, 2015 at 11:43:50 PM UTC-4, Vicente J. Botet Escriba
> wrote:
>>
>>  Le 03/06/15 00:39, Nicol Bolas a =C3=A9crit :
>>
>> On Tuesday, June 2, 2015 at 4:27:55 PM UTC-4, Thiago Macieira wrote:
>>>
>>> On Tuesday 02 June 2015 11:46:48 Nicol Bolas wrote:
>>> > Except that there's plenty of elision of potential for user-defined
>>> types.
>>> > Indeed, modern C++ syntax is designed around the assumption that
>>> elision
>>> > exists and will make code as fast as possible. Every time you see
>>> someone
>>> > write `T t =3D stuff();` instead of an explicit `stuff(&t, );`, you a=
re
>>> > implicitly relying on elision to make this fast.
>>> >
>>> > Why should MRVs undo this syntactic progress?
>>>
>>> In fact, our investigation showed that compilers optimise inline
>>> functions
>>> with multiple return values (structs, pairs, tuples) better than those
>>> with
>>> output parameters.
>>>
>>> For an example, see https://codereview.qt-project.org/106089.
>>>
>>
>>   Glad to see that some compilers perform better with a functional
>> interface, at least when functions are inlined.
>>
>
In this decade, the idea that compilers are really good at value semantics
(e.g. creating new values and returning them) and relatively not-so-good at
reference semantics (e.g. passing around references to use as
out-parameters) should not be shocking to anybody.  *Of course* value
semantics are going to win that fight.

For those who need convincing, Chandler Carruth's keynote from CppCon 2013
covers this topic extremely well.
https://www.youtube.com/watch?v=3DeR34r7HOU14

=E2=80=93Arthur

--=20

---=20
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 e=
mail 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-proposa=
ls/.

--f46d0438940d8f64e1051797353f
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Tue, Jun 2, 2015 at 11:20 PM, Vicente J. Botet Escriba =
<span dir=3D"ltr">&lt;<a href=3D"mailto:vicente.botet@wanadoo.fr" target=3D=
"_blank">vicente.botet@wanadoo.fr</a>&gt;</span> wrote:<br><div class=3D"gm=
ail_extra"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(=
204,204,204);border-left-style:solid;padding-left:1ex">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000">
    <div>Le 03/06/15 06:50, Nicol Bolas a
      =C3=A9crit=C2=A0:</div><span class=3D""><blockquote type=3D"cite">
      <div dir=3D"ltr">
        On Tuesday, June 2, 2015 at 11:43:50 PM UTC-4, Vicente J. Botet
        Escriba wrote:
        <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex=
;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style=
:solid;padding-left:1ex">
          <div bgcolor=3D"#FFFFFF" text=3D"#000000">
            <div>Le 03/06/15 00:39, Nicol Bolas a =C3=A9crit=C2=A0:</div><b=
lockquote type=3D"cite"><div dir=3D"ltr">
                On Tuesday, June 2, 2015 at 4:27:55 PM UTC-4, Thiago
                Macieira wrote:
                <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-le=
ft-style:solid;padding-left:1ex">On Tuesday 02 June 2015
                  11:46:48 Nicol Bolas wrote: <br>
                  &gt; Except that there&#39;s plenty of elision of
                  potential for user-defined types. <br>
                  &gt; Indeed, modern C++ syntax is designed around the
                  assumption that elision <br>
                  &gt; exists and will make code as fast as possible.
                  Every time you see someone <br>
                  &gt; write `T t =3D stuff();` instead of an explicit
                  `stuff(&amp;t, );`, you are <br>
                  &gt; implicitly relying on elision to make this fast.
                  <br>
                  &gt; <br>
                  &gt; Why should MRVs undo this syntactic progress? <br>
                  <br>
                  In fact, our investigation showed that compilers
                  optimise inline functions <br>
                  with multiple return values (structs, pairs, tuples)
                  better than those with <br>
                  output parameters. <br>
                  <br>
                  For an example, see <a href=3D"https://codereview.qt-proj=
ect.org/106089" rel=3D"nofollow" target=3D"_blank">https://codereview.qt-pr=
oject.org/106089</a>.
                  <br>
                </blockquote>
                <div><br>
                </div>
              </div>
            </blockquote>
            Glad to see that some compilers perform better with a
            functional interface, at least when functions are inlined.<br>
            </div></blockquote></div></blockquote></span></div></blockquote=
><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-le=
ft-style:solid;padding-left:1ex"><div class=3D""><div class=3D"h5"></div></=
div></blockquote></div></div><div class=3D"gmail_extra">In this decade, the=
 idea that compilers are really good at value semantics (e.g. creating new =
values and returning them) and relatively not-so-good at reference semantic=
s (e.g. passing around references to use as out-parameters) should not be s=
hocking to anybody. =C2=A0<i>Of course</i> value semantics are going to win=
 that fight.<br></div><div class=3D"gmail_extra"><br></div><div class=3D"gm=
ail_extra"><div class=3D"gmail_extra">For those who need convincing, Chandl=
er Carruth&#39;s keynote from CppCon 2013 covers this topic extremely well.=
</div><div class=3D"gmail_extra"><a href=3D"https://www.youtube.com/watch?v=
=3DeR34r7HOU14">https://www.youtube.com/watch?v=3DeR34r7HOU14</a><br></div>=
<div><br></div></div><div class=3D"gmail_extra">=E2=80=93Arthur</div></div>

<p></p>

-- <br />
<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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--f46d0438940d8f64e1051797353f--

.
