220 31196 <fb147f1a-a9c1-4a7e-b783-e91ee51d5532@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Removing forward references ("universal"
 references) from the standard
Date: Mon, 27 Feb 2017 16:32:45 -0800 (PST)
Lines: 106
Approved: news@gmane.org
Message-ID: <fb147f1a-a9c1-4a7e-b783-e91ee51d5532@isocpp.org>
References: <f4a47328-5397-4e93-9453-ddb978256627@isocpp.org>
 <69c0683c-3b36-4de4-941d-9487366615d6@isocpp.org>
 <77fd5ab0-76dc-47d5-b0cc-cd7f0a32f921@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2301_1104877832.1488241965212"
X-Trace: blaine.gmane.org 1488241967 21182 195.159.176.226 (28 Feb 2017 00:32:47 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 28 Feb 2017 00:32:47 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBLUK2PCQKGQEUD55OKA@isocpp.org Tue Feb 28 01:32:41 2017
Return-path: <std-proposals+bncBCEKFTV6ZUMBBLUK2PCQKGQEUD55OKA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f200.google.com ([209.85.161.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBLUK2PCQKGQEUD55OKA@isocpp.org>)
	id 1ciVib-00050Z-Cp
	for gclcip-std-proposals@m.gmane.org; Tue, 28 Feb 2017 01:32:41 +0100
Original-Received: by mail-yw0-f200.google.com with SMTP id 2sf167498876ywn.1
        for <gclcip-std-proposals@m.gmane.org>; Mon, 27 Feb 2017 16:32: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=pvFbM2ghypv7cnKCfM/QPi61zqdEryuG+HMn5TbiFTI=;
        b=uy9dq8FlJOoCw5nAi6GXvd3akv5d2OqYHHAae24FDhMwecGuoUHtW4zO2zOnLYA6Ja
         OXhJL7UuvXe9m8I7m4deVePO8Z8gj3+sOB7Z0EAYxTYVZpnEF1tNOAqReYC7dsWVjHGG
         shPUlk11Nm76MIzYb14oqNudhDJ8wLZCC1G7a41gzuoz8K4VveFCWC1AqQSv2WGbK8Wk
         1T0FBeNFea5BKELNZto4neLvF+OaYGXmaPkQ/KbLvq3K2BoWRu9G5nZBbsjZ7bzH5KRe
         /Xgq6nTgnNjALj6iQBPnFtQtTXfQna82FeZ/fSTy0tmP2mCuR+KH7csyeH01E4I6k5Ra
         JGdQ==
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=pvFbM2ghypv7cnKCfM/QPi61zqdEryuG+HMn5TbiFTI=;
        b=TVEkhl8bAP1kjg3OiEJQ2QrBjnG0zda2cSdNLfrThynKqnOTVN8YXle+hxFDmQtC+i
         MZd2gBt4OKytuwBtOJNnQUXyszEIfQvrmygIJDmDe1pUdgypht4qMJN0AfioQxZE2r/6
         OSzk2NtlU8Uy1ffjLckf8M3k3WbglZ55zIKM/cCwA4cZ0qjjoQ87sUPWlw3I2j3djbl0
         aunMAWqU/gpnNm87412IiT70ErIX7IwyXiDaAeh1J/hQtpvHVVHuHUx6ot38hOJSzuz5
         4H90/WyWaC0XcDoUgivZDZsLcaQfLPvZigGj3kx2lLJF+ix5r1526rUCghE40Fu9VX3t
         0ecg==
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=pvFbM2ghypv7cnKCfM/QPi61zqdEryuG+HMn5TbiFTI=;
        b=S81HhX2NsUj+W9PBB+0k4yBs4uWBqN79GfqFn4lpe2UP9I1QdB2fkI+eb5Wq/eKq/n
         zJhcpt9PCMmQrS5vnGy0wpTcN8b7UXHH9Hn6Ay5nKPo/MR45BVYZ3fKjh0hAuJp4Ro6+
         w9UJur84qnvshzpNDchbvtymZa/3a1RkoSzOIK+FxbdWfypMkrzYOXWVkwRK9hBCugQ/
         Xm8lM/R/UkjeSmamRwQVpTBJY/a2EBaJgDBKvIKUSUtjs0pS4DPNhv2UyaykMvf56qqd
         mqBw2nrxyXoj+vk/LOz2omUPN42CsrLve0lgZmdUtbGsqIpyo2ZJP7j7zIwJdjIG8TAy
         G2iA==
X-Gm-Message-State: AMke39lQoGeJ/gms4c1UtANL+R90fMDx45SgvxVuaBrVQaeonFwDWZIK/99whhZIGwETXQ==
X-Received: by 10.129.175.31 with SMTP id n31mr7502324ywh.30.1488241967093;
        Mon, 27 Feb 2017 16:32:47 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.18.240 with SMTP id g103ls13738644otg.39.gmail; Mon, 27
 Feb 2017 16:32:45 -0800 (PST)
X-Received: by 10.157.68.226 with SMTP id p34mr1129776otg.8.1488241965938;
        Mon, 27 Feb 2017 16:32:45 -0800 (PST)
In-Reply-To: <77fd5ab0-76dc-47d5-b0cc-cd7f0a32f921@isocpp.org>
X-Original-Sender: jmckesson@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:31196
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31196>

------=_Part_2301_1104877832.1488241965212
Content-Type: multipart/alternative; 
	boundary="----=_Part_2302_2132747203.1488241965212"

------=_Part_2302_2132747203.1488241965212
Content-Type: text/plain; charset=UTF-8

On Monday, February 27, 2017 at 3:39:16 PM UTC-5, Denis Kotov wrote:
>
> 3) If you anyway think that forwarding reference is useful, can you give 
> an example of usefulness ?
>

.... oh, now I get what the problem is.

It now seems apparent that you are under the impression that forwarding 
references are some kind of accident. That nobody really thought about the 
reference collapsing and template argument deduction of rvalues. That 
forwarding references were something effect that came out of the natural 
growth of rvalue references and template deduction.

Forwarding references didn't happen by accident; the specific reference 
collapsing rules that led to forwarding references were added *deliberately 
and purposefully* to C++0x's rvalue reference system (which in its original 
form didn't behave like this). They were added to solve a specific and 
pernicious problem. Namely the forwarding problem, which is why these rules 
(and `std::forward`) are often collectively referred to as "perfect 
forwarding". Proper use of forwarding references solves the forwarding 
problem, thus allowing *numerous* C++ functions to exist and do their jobs 
correctly and without creating unnecessary copies or inhibiting moves.

If you want to understand the forwarding problem in detail, read the paper 
that introduced these reference collapsing rules to C++ 
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm>. But 
until you understand the purpose that forwarding references *currently 
serve*, we cannot effectively discuss whether or not it is reasonable to 
remove them.

In order to remove forwarding references, you would need to re-solve the 
forwarding problem. Because we're not going to give up our only solution to 
that just because it confuses you.

Also, please stop top-posting.

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/fb147f1a-a9c1-4a7e-b783-e91ee51d5532%40isocpp.org.

------=_Part_2302_2132747203.1488241965212
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Monday, February 27, 2017 at 3:39:16 PM UTC-5, Denis Ko=
tov wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:=
 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">3) =
If you anyway think that forwarding reference is useful, can you give an ex=
ample of usefulness ?</div></blockquote><div><br>... oh, now I get what the=
 problem is.<br><br>It now seems apparent that you are under the impression=
 that forwarding references are some kind of accident. That nobody really t=
hought about the reference collapsing and template argument deduction of rv=
alues. That forwarding references were something effect that came out of th=
e natural growth of rvalue references and template deduction.<br><br>Forwar=
ding references didn&#39;t happen by accident; the specific reference colla=
psing rules that led to forwarding references were added <i>deliberately an=
d purposefully</i>
 to C++0x&#39;s rvalue reference system (which in its original form didn&#3=
9;t=20
behave like this). They were added to solve a specific and pernicious=20
problem. Namely the forwarding problem, which is why these rules (and=20
`std::forward`) are often collectively referred to as &quot;perfect forward=
ing&quot;. Proper use
 of forwarding references solves the forwarding problem, thus allowing <i>n=
umerous</i> C++ functions to exist and do their jobs correctly and without =
creating unnecessary copies or inhibiting moves.<br><br>If you want to unde=
rstand the forwarding problem in detail, read <a href=3D"http://www.open-st=
d.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm">the paper that introduced =
these reference collapsing rules to C++</a>. But until you understand the p=
urpose that forwarding references <i>currently serve</i>, we cannot effecti=
vely discuss whether or not it is reasonable to remove them.<br><br>In orde=
r to remove forwarding references, you would need to re-solve the forwardin=
g problem. Because we&#39;re not going to give up our only solution to that=
 just because it confuses you.</div><br>Also, please stop top-posting.<br><=
/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/fb147f1a-a9c1-4a7e-b783-e91ee51d5532%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/fb147f1a-a9c1-4a7e-b783-e91ee51d5532=
%40isocpp.org</a>.<br />

------=_Part_2302_2132747203.1488241965212--

------=_Part_2301_1104877832.1488241965212--

.
