220 31192 <69c0683c-3b36-4de4-941d-9487366615d6@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Arthur O'Dwyer <arthur.j.odwyer@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Removing forward references ("universal"
 references) from the standard
Date: Mon, 27 Feb 2017 11:51:45 -0800 (PST)
Lines: 126
Approved: news@gmane.org
Message-ID: <69c0683c-3b36-4de4-941d-9487366615d6@isocpp.org>
References: <f4a47328-5397-4e93-9453-ddb978256627@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_7050_1470126613.1488225105152"
X-Trace: blaine.gmane.org 1488225109 27131 195.159.176.226 (27 Feb 2017 19:51:49 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 27 Feb 2017 19:51:49 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDLZJYWNDQINDBWSYUCRUBCR4MKU2@isocpp.org Mon Feb 27 20:51:43 2017
Return-path: <std-proposals+bncBDLZJYWNDQINDBWSYUCRUBCR4MKU2@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-it0-f70.google.com ([209.85.214.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDLZJYWNDQINDBWSYUCRUBCR4MKU2@isocpp.org>)
	id 1ciRKe-0006Kk-Pj
	for gclcip-std-proposals@m.gmane.org; Mon, 27 Feb 2017 20:51:41 +0100
Original-Received: by mail-it0-f70.google.com with SMTP id 203sf99535112ith.3
        for <gclcip-std-proposals@m.gmane.org>; Mon, 27 Feb 2017 11:51:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=p1I+S37amhuRSvwZGCT/ugRH8I4mBlV9RhQ8h13KUG8=;
        b=cL2i55TAp7gKCvtUq63F5nST2n8cCNKmy92la6LJXL281yYh0s5gP7cUmI202VkBfN
         dMEKNcxO05EA3GU3ZefsuDqPsZhwMbeNJEL4zDyhTBqYlOFo2h5EhibYHMEynet1uyCH
         ycKw/dK4NJBQldHFrkHCkaVS7Ws49T+02PTIjpWh8+L2SVox7ihYfu3s4TJK6V3DFfmX
         gS+SW8RIgOO0/+CpSPtqaoD55xzXsUgFcDEwy6J631BWipIQhW0/EuXgzX2xhU2YxOAR
         465xsuEls7ezWycOCuvo9iyOewIgHNKNEurLa2I6+apHVQxKxGgu1GH/lQL2/dXVERbp
         spsw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=p1I+S37amhuRSvwZGCT/ugRH8I4mBlV9RhQ8h13KUG8=;
        b=R4KRCdvSIz0cAzo5rbPNfTMCL7UebPVFnl4g91PIUZdJ+Ac9L7oLSWV7ZijWKmPBUp
         sSQ+pjlubyV9DgjeU7xgVkzBNcY0FMwwfwrTyYdgcd3L9phmrEnW7JlBG/Rt70NwTfXN
         fTJstscx/aikxXhOSPEhIVQzoIKJcJMs62dUEk7duK56OwupLvpxEPUlhPBqup+MYsKS
         vrFf0gyXt1k74IYUwrEL2meGyDi1nADCvInang6pZwPh2DhdxdzkEfEiiDn5Ixrno8Uk
         QL2tw+6gYJcM/8mBG9W+AHLfagVKZ4oZKW52xpyxxoH6kEi26cNJn8uVHXVbys89O8rj
         O0+w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=p1I+S37amhuRSvwZGCT/ugRH8I4mBlV9RhQ8h13KUG8=;
        b=Jn4B86JvSyJSltWXWks7kPOTYxsuRsOe89wdVLr817xWTo1slDz+maNtLjCI4l3KMH
         tm68FH7F9dxwP5+T1hc/96rbYc7pWhGYBtU8DrzUuy3yL4jOFAfN+1YVosW0YpsiIFnM
         ETeTPeDSemOnZeoM/8ginA/N2YJHM+UXKhCCJ3Fn6tWpNTX2a/AcbkAQLFpFQtTOztyJ
         Vsf6lt0Anza0PeIRgsvagz3eFO1gnVxX+fBQa7FMdRXHlAn5iUCAobgG9lkmOsZJEdHS
         piPu1IXq+ZtnCoWfkC47Jcu+JS8yB8gaqy/8XkKFxu2HFPsCHCOazTxrn1QeeK8d3P6R
         OLbg==
X-Gm-Message-State: AMke39njduXoenQrzTKjvz85sX+/x1B+lLh2WxEvoed+YEeqD+SJrAcNsoHWKcJXw1DWLw==
X-Received: by 10.36.117.11 with SMTP id y11mr846847itc.3.1488225106480;
        Mon, 27 Feb 2017 11:51:46 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.8.69 with SMTP id 63ls14292342oty.0.gmail; Mon, 27 Feb
 2017 11:51:45 -0800 (PST)
X-Received: by 10.157.32.3 with SMTP id n3mr1047412ota.1.1488225105710;
        Mon, 27 Feb 2017 11:51:45 -0800 (PST)
In-Reply-To: <f4a47328-5397-4e93-9453-ddb978256627@isocpp.org>
X-Original-Sender: arthur.j.odwyer@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: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:31192
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31192>

------=_Part_7050_1470126613.1488225105152
Content-Type: multipart/alternative; 
	boundary="----=_Part_7051_1106779844.1488225105153"

------=_Part_7051_1106779844.1488225105153
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Saturday, February 25, 2017 at 11:43:16 PM UTC-8, Denis Kotov wrote:
>
>
> My proposal is very simple. Just remove completely forward references=20
> because of confusion that it makes until it is not too late !!
> Basically if we have the following example:
>
>     template<typename T>
>     void setItem(T && t)
>     {
>         ...
>         // T can be *lvalue *or *rvalue *reference as all of you know    =
=20
>   =20
>     }
>
> But it confuses ( I think ) all of us.
>

Nope!  Reference collapsing has been in the language since 1998, although=
=20
its exact semantics were not standardized until 2011 as far as I know.
If you find reference collapsing confusing, I suggest that you watch my=20
CppCon 2016 talk "Template Normal Programming"[1], which covers the=20
difference between lvalue and rvalue references and explains the rule for=
=20
collapsing them together. (In short: if anyone else in the world claims to=
=20
care about an object, you're not allowed to disembowel that object.)  Once=
=20
you understand reference collapsing, "forwarding references" (formerly=20
known as "universal references", formerly known as "just this particular=20
syntax for exploiting reference collapsing in template contexts") falls out=
=20
naturally.

So it would be reasonable (IMHO) to say that the term "forwarding=20
reference" is unnecessary and therefore confusing; but personally I find it=
=20
useful to have a term for the thing that's less cumbersome than "this=20
particular syntax for exploiting reference collapsing" or "an rvalue=20
reference to a cv-unqualified template parameter that does not represent a=
=20
template parameter of a class template" or whatever.

HTH,
=E2=80=93Arthur

[1] - https://www.youtube.com/watch?v=3DvwrXHznaYLA (circa the 35-minute ma=
rk)

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/69c0683c-3b36-4de4-941d-9487366615d6%40isocpp.or=
g.

------=_Part_7051_1106779844.1488225105153
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Saturday, February 25, 2017 at 11:43:16 PM UTC-8, Denis=
 Kotov wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">=
<div><br></div><div>My proposal is very simple. Just remove completely=C2=
=A0forward references because of confusion that it makes until it is not to=
o late !!</div><div>Basically if we have the following example:</div><div><=
br></div><div>=C2=A0 =C2=A0 template&lt;typename T&gt;</div><div>=C2=A0 =C2=
=A0 void setItem(T &amp;&amp; t)</div><div>=C2=A0 =C2=A0 {</div><div>=C2=A0=
 =C2=A0 =C2=A0 =C2=A0 ...</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 // T can be=
 <b>lvalue </b>or <b>rvalue </b>reference as all of you know =C2=A0 =C2=A0 =
=C2=A0 =C2=A0</div><div>=C2=A0 =C2=A0 }</div><div><br></div><div>But it con=
fuses ( I think ) all of us.</div></div></blockquote><div><br></div><div>No=
pe! =C2=A0Reference collapsing has been in the language since 1998, althoug=
h its exact semantics were not standardized until 2011 as far as I know.</d=
iv><div>If you find reference collapsing confusing, I suggest that you watc=
h my CppCon 2016 talk &quot;Template Normal Programming&quot;[1], which cov=
ers the difference between lvalue and rvalue references and explains the ru=
le for collapsing them together. (In short: if anyone else in the world cla=
ims to care about an object, you&#39;re not allowed to disembowel that obje=
ct.) =C2=A0Once you understand reference collapsing, &quot;forwarding refer=
ences&quot; (formerly known as &quot;universal references&quot;, formerly k=
nown as &quot;just this particular syntax for exploiting reference collapsi=
ng in template contexts&quot;) falls out naturally.</div><div><br></div><di=
v>So it would be reasonable (IMHO) to say that the term &quot;forwarding re=
ference&quot; is unnecessary and therefore confusing; but personally I find=
 it useful to have a term for the thing that&#39;s less cumbersome than &qu=
ot;this particular syntax for exploiting reference collapsing&quot; or &quo=
t;an rvalue reference to a cv-unqualified template parameter that does not =
represent a template parameter of a class template&quot; or whatever.</div>=
<div><br></div><div>HTH,</div><div>=E2=80=93Arthur</div><div><br></div><div=
>[1] -=C2=A0https://www.youtube.com/watch?v=3DvwrXHznaYLA (circa the 35-min=
ute mark)</div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/69c0683c-3b36-4de4-941d-9487366615d6%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/69c0683c-3b36-4de4-941d-9487366615d6=
%40isocpp.org</a>.<br />

------=_Part_7051_1106779844.1488225105153--

------=_Part_7050_1470126613.1488225105152--

.
