220 36331 <4a8c1326-d560-4d57-b8ab-afc85d627166@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: bastienpenava@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Now that the std::forward alternative has been rejected
Date: Sun, 24 Dec 2017 22:17:11 -0800 (PST)
Lines: 247
Approved: news@gmane.org
Message-ID: <4a8c1326-d560-4d57-b8ab-afc85d627166@isocpp.org>
References: <ebc148fa-9b1f-4972-8a53-6f52c6ead259@isocpp.org>
 <e447b9dd-d8d1-4b73-b1f3-4a6a5ab295a5@isocpp.org>
 <1a84e87b-c045-408c-9828-b1aba2185a0a@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_14791_1304117373.1514182631317"
X-Trace: blaine.gmane.org 1514182519 17948 195.159.176.226 (25 Dec 2017 06:15:19 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 25 Dec 2017 06:15:19 +0000 (UTC)
Cc: mihailnajdenov@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCG3XHNI6IDRB2FPQLJAKGQEHPCAQEA@isocpp.org Mon Dec 25 07:15:14 2017
Return-path: <std-proposals+bncBCG3XHNI6IDRB2FPQLJAKGQEHPCAQEA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f198.google.com ([209.85.217.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCG3XHNI6IDRB2FPQLJAKGQEHPCAQEA@isocpp.org>)
	id 1eTM2Z-0003za-93
	for gclcip-std-proposals@m.gmane.org; Mon, 25 Dec 2017 07:15:11 +0100
Original-Received: by mail-ua0-f198.google.com with SMTP id v15sf20714143uae.23
        for <gclcip-std-proposals@m.gmane.org>; Sun, 24 Dec 2017 22:17:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=xAv2PMd9TbI448AtvASCs5e4ofbb4L0w7oL83sFLsCw=;
        b=gyog3XvEADHzkD9h9xQXmpiliGQLv537c9R4g5D51mTL4di/JiS7/Rwl3KlPScDdy7
         MTMHCukpt47YFrtVI1y0n0Va0bFvSIBsGBPerm9CDsSweZGpApTUXQ/NObYt8RvX0cIk
         BAVrOfY3DQUomUqQ/AHW/UHg3fBtyj79TQKx/ZAaiJ7UQ7aKlYxafwVkiHsZw44cv5Hj
         Pgh/A3/YmUuDuF7pGBiUKLNMFMRqbw2ADHuh0dxA5z0OPQuLIcoZqMgKd/ODppKDL2n5
         ocm1rsy9DXjQF+XW+D7ddNJ4ObNy+ce9s94Q/xPeCrcEqOr2rIK4uNRj34nFXRpcpZ68
         x2hw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=xAv2PMd9TbI448AtvASCs5e4ofbb4L0w7oL83sFLsCw=;
        b=haL9OuHoWAGmSbf03x1mwEelApg6S58RI+BHARmtUwXsfRFt6SaKMBTWzIsWomDIzu
         6jgOpanEGiRqduesUp/iPAUfntydDOHXW8VyB823/NKHR26nlmcTkcpszQZfS5tFWbbS
         ++4BQ1WixAXyJdMCI82GsFZfbxmMxYMFQUgy2xeE2T5DHYPBVULybOESgUB5rWyNXeCf
         PAzRty6YaojulD418ZULHirzz/mzY4ZsxtT49phRRnga9nGO1FkSNFizya2LAzwbPcHj
         e2W4u7cLz4juTbLamR7o+SVNEmf6ZjRNZ91G6C1ChuCGifGjP4cdRql+04baRP7IJY2+
         oqAg==
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:cc: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=xAv2PMd9TbI448AtvASCs5e4ofbb4L0w7oL83sFLsCw=;
        b=BI7QNcoKbJ2BZJfqPEaigLOxjg/mVWDuET3x1BwR3hMvIBaMHw2c9YYaFe4Fya9PMt
         ebBL9OomTCREJzvEp0hLpWmClg2LOd8kHy7u5y7skd5Qhs6Ht3XVn5b/sBUKUU28YC1L
         Sozv3QR8jrpqkIHvEpLztufRLIDvcRBiS3ZCqkr5VN0LG8hXm9Mcnx5Pn3w137wtzE2V
         4Wlm/Bgw+Rx5+PLDG6OVu0wtmc1F30p3pTumgeeetm55RwNe3FeirmW2SS3jdnzhBpu1
         tR5tvsmZtRpLrYL7GbVRZIqhB0heaDr6Zg7ooib17ujgNujeiUUy3S4bd6sKQ/UjOFgV
         J5LQ==
X-Gm-Message-State: AKGB3mL66cbBC+ZYSWxuyH6fmob0Y0sv5lFIQgJ1/w5KlzypqNMs8vcB
	ZBH9Th0vdHG8euUOIMOfMc3eag==
X-Google-Smtp-Source: ACJfBov/AKuQ1yh2W2RyIrTcQaAD0aiL67utOb5ScsDtqExsSBz94oGQX+S/zv68ppJv8QotP7Pf0A==
X-Received: by 10.31.1.214 with SMTP id 205mr9314563vkb.13.1514182633647;
        Sun, 24 Dec 2017 22:17:13 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.31.150.196 with SMTP id y187ls2574787vkd.10.gmail; Sun, 24 Dec
 2017 22:17:12 -0800 (PST)
X-Received: by 10.31.171.73 with SMTP id u70mr1988682vke.10.1514182631940;
        Sun, 24 Dec 2017 22:17:11 -0800 (PST)
In-Reply-To: <1a84e87b-c045-408c-9828-b1aba2185a0a@isocpp.org>
X-Original-Sender: BastienPenava@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: 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:36331
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/36331>

------=_Part_14791_1304117373.1514182631317
Content-Type: multipart/alternative; 
	boundary="----=_Part_14792_2065278301.1514182631318"

------=_Part_14792_2065278301.1514182631318
Content-Type: text/plain; charset="UTF-8"



On Monday, December 25, 2017 at 5:28:05 AM UTC+1, Nicol Bolas wrote:
>
> On Sunday, December 24, 2017 at 8:17:30 PM UTC-5, bastie...@gmail.com 
> wrote:
>>
>> On Sunday, December 24, 2017 at 9:47:30 AM UTC+1, mihailn...@gmail.com 
>> wrote:
>>>
>>> Hello, I read 
>>> <https://botondballo.wordpress.com/2017/11/20/trip-report-c-standards-meeting-in-albuquerque-november-2017/> 
>>> the proposal "Forward without forward" has been rejected.
>>>
>>> Now, can we please reconsider fixing forward "the right way" even if it 
>>> involves hacks?
>>>
>>> And by "the right way" a mean, of course, let the template param be 
>>> omitted.
>>>
>>> Why is the right way? Multiple reasons:
>>>
>>>
>>>    1. Preserve the API taught for close to 10 years now.
>>>
>>> actually this is false.std::forward without template param is valid and 
>> your change would change its meaning.
>>
>>>
>>>    1. Remove confusion for EVERYONE learning C++11+, be at a beginner 
>>>    or advanced user.
>>>    2. The param is confusing on its own (to a beginner) - should I pass 
>>>    T or T&&, what happens if I pass const T, const T&&, T*? Do I really have 
>>>    options here?!? Or Just One Right Param?!?!
>>>
>>> std::forward is fairly easy to explain to a beginner.
>>
>
> No, it's not. It's easy to tell a beginner what they have to do and when 
> they have to do it. But explaining what it actually is doing (beyond 
> simplistic "it's forwarding the parameters") is not easy. 
>
 
>

> But even if it wasn't the case, cases where std::forward is required are 
>> not for beginners (library writing, etc...).
>>
>
> Nonsense. Writing passthrough functions should be in* everyone's* 
> toolkit, not just "library writers". Thinking like that is what makes 
> people think that template metaprogramming is OK, because regular C++ 
> programmers shouldn't want to do things like iterate over things at compile 
> time or somesuch.
>
good passthrough functions will never be easy to write in C++. The 
committee is not interested. The lambda abbreviated proposal by the same 
person (which also applied to functions) aimed to make it easier and got 
shutdown hard.

>
> Making the powers of the language more accessible is not a bad thing.
>
What makes you think I disagree with that ?
If anything I am an advocate of the original proposal of Barry Revzin.
I disagree though that It should be fixed by creating an implementation 
defined library solution that violates the behaviour of a function and its 
arguments.
We don't need more weird exceptions.

>
>
>>>    1. The param is an ugly nightmare to pass in [](auto) {} scenario
>>>
>>> C++20 has template parameter for lambda so this is no longer a valid 
>> issue.
>>
>
> Which only trades one verbosity for another. 
>
Being ugly and being verbose are two different things.

>
> [](auto&&... args) {return some_func(std::forward<decltype(args)>(args
> )...);}
>
> vs.
>
> []<template ...Args>(Args &&...args) {return some_func(std::forward<Args>(
> args)...);}
>
> This is not an improvement. 
>

> And code like this is certainly not limited to "library writers". Not 
> unless C++ gets lifting lambdas/overload set lambdas (and that's sadly 
> unlikely at this point). And even if we had that feature, we'd still need 
> this. 
>

-- 
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/4a8c1326-d560-4d57-b8ab-afc85d627166%40isocpp.org.

------=_Part_14792_2065278301.1514182631318
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Monday, December 25, 2017 at 5:28:05 AM UTC+1, =
Nicol Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"=
ltr">On Sunday, December 24, 2017 at 8:17:30 PM UTC-5, <a>bastie...@gmail.c=
om</a> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-lef=
t:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Su=
nday, December 24, 2017 at 9:47:30 AM UTC+1, <a>mihailn...@gmail.com</a> wr=
ote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>Hello, <a=
 href=3D"https://botondballo.wordpress.com/2017/11/20/trip-report-c-standar=
ds-meeting-in-albuquerque-november-2017/" rel=3D"nofollow" target=3D"_blank=
" onmousedown=3D"this.href=3D&#39;https://www.google.com/url?q\x3dhttps%3A%=
2F%2Fbotondballo.wordpress.com%2F2017%2F11%2F20%2Ftrip-report-c-standards-m=
eeting-in-albuquerque-november-2017%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAF=
QjCNF_vL5Ngr4VIpnzXg9U_LHKICBxaA&#39;;return true;" onclick=3D"this.href=3D=
&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fbotondballo.wordpress.co=
m%2F2017%2F11%2F20%2Ftrip-report-c-standards-meeting-in-albuquerque-novembe=
r-2017%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF_vL5Ngr4VIpnzXg9U_LHKICB=
xaA&#39;;return true;">I read</a> the proposal &quot;Forward without forwar=
d&quot; has been rejected.</div><div><br></div><div>Now, can we please reco=
nsider fixing forward &quot;the right way&quot; even if it involves hacks?<=
/div><div><br></div><div>And by &quot;the right way&quot; a mean, of course=
, let the template param be omitted.</div><div><br></div><div>Why is the ri=
ght way? Multiple reasons:</div><div><br></div><ol><li>Preserve the API tau=
ght for close to 10 years now.</li></ol></div></blockquote><div>actually th=
is is false.std::forward without template param is valid and your change wo=
uld change its meaning.</div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div d=
ir=3D"ltr"><ol><li>Remove confusion for EVERYONE learning C++11+, be at a b=
eginner or advanced user.</li><li>The param is confusing on its own (to a b=
eginner) - should I pass T or T&amp;&amp;, what happens if I pass const T, =
const T&amp;&amp;, T*? Do I really have options here?!? Or Just One Right P=
aram?!?!</li></ol></div></blockquote><div>std::forward is fairly easy to ex=
plain to a beginner.</div></div></blockquote><div><br></div><div>No, it&#39=
;s not. It&#39;s easy to tell a beginner what they have to do and when they=
 have to do it. But explaining what it actually is doing (beyond simplistic=
 &quot;it&#39;s forwarding the parameters&quot;) is not easy.=C2=A0</div></=
div></blockquote><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><div>=C2=A0</div></div></blockquote><blockquote class=3D"gmail_quote" s=
tyle=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-le=
ft: 1ex;"><div dir=3D"ltr"><div><br></div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-lef=
t:1ex"><div dir=3D"ltr"><div>But even if it wasn&#39;t the case, cases wher=
e std::forward is required are not for beginners (library writing, etc...).=
</div></div></blockquote><div><br></div><div>Nonsense. Writing passthrough =
functions should be in<i> everyone&#39;s</i> toolkit, not just &quot;librar=
y writers&quot;. Thinking like that is what makes people think that templat=
e metaprogramming is OK, because regular C++ programmers shouldn&#39;t want=
 to do things like iterate over things at compile time or somesuch.</div></=
div></blockquote><div>good passthrough functions will never be easy to writ=
e in C++. The committee is not interested. The lambda abbreviated proposal =
by the same person (which also applied to functions) aimed to make it easie=
r and got shutdown hard.</div><blockquote class=3D"gmail_quote" style=3D"ma=
rgin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">=
<div dir=3D"ltr"><div><br></div><div>Making the powers of the language more=
 accessible is not a bad thing.</div></div></blockquote><div>What makes you=
 think I disagree with that ?</div><div>If anything I am an advocate of the=
 original proposal of Barry Revzin.</div><div>I disagree though that It sho=
uld be fixed by creating an implementation defined library solution that vi=
olates the behaviour of a function and its arguments.</div><div>We don&#39;=
t need more weird exceptions.</div><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"><div><br></div><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1e=
x"><div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin:0;mar=
gin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr=
"><ol><li>The param is an ugly nightmare to pass in [](auto) {} scenario</l=
i></ol></div></blockquote><div>C++20 has template parameter for lambda so t=
his is no longer a valid issue.</div></div></blockquote><div><br></div><div=
>Which only trades one verbosity for another.=C2=A0</div></div></blockquote=
><div>Being ugly and being verbose are two different things.</div><blockquo=
te class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left:=
 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div><br></div><div st=
yle=3D"border:1px solid rgb(187,187,187);word-wrap:break-word;background-co=
lor:rgb(250,250,250)"><code><div><span style=3D"color:#660">[](</span><span=
 style=3D"color:#008">auto</span><span style=3D"color:#660">&amp;&amp;...</=
span><span style=3D"color:#000"> args</span><span style=3D"color:#660">)</s=
pan><span style=3D"color:#000"> </span><span style=3D"color:#660">{</span><=
span style=3D"color:#008">return</span><span style=3D"color:#000"> some_fun=
c</span><span style=3D"color:#660">(</span><span style=3D"color:#000">std</=
span><span style=3D"color:#660">::</span><span style=3D"color:#000">forward=
</span><span style=3D"color:#660">&lt;</span><span style=3D"color:#008">dec=
ltyp<wbr>e</span><span style=3D"color:#660">(</span><span style=3D"color:#0=
00">args</span><span style=3D"color:#660">)&gt;(</span><span style=3D"color=
:#000">args</span><span style=3D"color:#660">)...);}</span></div></code></d=
iv><div><br></div><div>vs.</div><div><br></div><div style=3D"border:1px sol=
id rgb(187,187,187);word-wrap:break-word;background-color:rgb(250,250,250)"=
><code><div><span style=3D"color:#660">[]&lt;</span><span style=3D"color:#0=
08">template</span><span style=3D"color:#000"> </span><span style=3D"color:=
#660">...</span><span style=3D"color:#606">Args</span><span style=3D"color:=
#660">&gt;(</span><span style=3D"color:#606">Args</span><span style=3D"colo=
r:#000"> </span><span style=3D"color:#660">&amp;&amp;...</span><span style=
=3D"color:#000">args</span><span style=3D"color:#660">)</span><span style=
=3D"color:#000"> </span><span style=3D"color:#660">{</span><span style=3D"c=
olor:#008">return</span><span style=3D"color:#000"> some_func</span><span s=
tyle=3D"color:#660">(</span><span style=3D"color:#000">std</span><span styl=
e=3D"color:#660">::</span><span style=3D"color:#000">forward</span><span st=
yle=3D"color:#660">&lt;</span><span style=3D"color:#606">Args</span><span s=
tyle=3D"color:#660">&gt;(</span><span style=3D"color:#000">a<wbr>rgs</span>=
<span style=3D"color:#660">)...);}</span><span style=3D"color:#000"><br></s=
pan></div></code></div><div><br></div><div>This is not an improvement.=C2=
=A0</div></div></blockquote><blockquote class=3D"gmail_quote" style=3D"marg=
in: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><d=
iv dir=3D"ltr"><div><br></div><div>And code like this is certainly not limi=
ted to &quot;library writers&quot;. Not unless C++ gets lifting lambdas/ove=
rload set lambdas (and that&#39;s sadly unlikely at this point). And even i=
f we had that feature, we&#39;d still need this.=C2=A0<br></div></div></blo=
ckquote></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/4a8c1326-d560-4d57-b8ab-afc85d627166%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/4a8c1326-d560-4d57-b8ab-afc85d627166=
%40isocpp.org</a>.<br />

------=_Part_14792_2065278301.1514182631318--

------=_Part_14791_1304117373.1514182631317--

.
