220 29942 <ec154f31-d0a7-4e4d-910b-87986be2d720@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: "T. C." <rs2740@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Extending the scope of generalized lambda
 captures to include the lambda's trailing return type
Date: Mon, 19 Dec 2016 14:32:17 -0800 (PST)
Lines: 131
Approved: news@gmane.org
Message-ID: <ec154f31-d0a7-4e4d-910b-87986be2d720@isocpp.org>
References: <f804aae4-6aeb-4239-9deb-23c9daeed950@isocpp.org>
 <cba1a1fa-d3c8-43e0-a1b5-f69fb285a680@isocpp.org>
 <78e69be6-4dfd-4949-85d9-145097ea2580@isocpp.org>
 <cfe4e68c-9fc1-44fa-9b09-011b3bd15c2c@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1273_1934345736.1482186737480"
X-Trace: blaine.gmane.org 1482186741 7404 195.159.176.226 (19 Dec 2016 22:32:21 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 19 Dec 2016 22:32:21 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCQ43G7NQIIRB4V74HBAKGQECBKCFTQ@isocpp.org Mon Dec 19 23:32:17 2016
Return-path: <std-proposals+bncBCQ43G7NQIIRB4V74HBAKGQECBKCFTQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pg0-f70.google.com ([74.125.83.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCQ43G7NQIIRB4V74HBAKGQECBKCFTQ@isocpp.org>)
	id 1cJ6Te-0000h9-JG
	for gclcip-std-proposals@m.gmane.org; Mon, 19 Dec 2016 23:32:14 +0100
Original-Received: by mail-pg0-f70.google.com with SMTP id b1sf247279995pgc.5
        for <gclcip-std-proposals@m.gmane.org>; Mon, 19 Dec 2016 14:32:19 -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=Bvr0X7orrDnjEYTI2i050H6TUE46yw7KNBtSAX2Ngzo=;
        b=gszFI1BBqsD0Iw2EUwAQ1R9b4FPKyjEvT16hAccEBJrmIhXolX1cW1PyhXoKdqUzWz
         xohKLYFXMMCcrsJwbNz3yi7z7miAyhWGc3dzqFUYDIXeWAwb091T0rXi57X84p9ct5Ip
         9j5eMkcb0s6r4h28yROUK510Le3qB3rohEzGhRAGVc4UYMQOZ5xK9bmXnNTjvCvEn4E/
         UPVB4roGEp+QNWBY7kcx14c/KQjD7hg/5s9X09gpqfHgDuYDvyzZowUR2xDPT0JCJ1mH
         +2uvmPXXsaYrpanG/JiM00rfDfko3eTeZT+kEhgkMQUXiGzinabimAwpgHnn1VLlZ7q4
         9G0A==
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=Bvr0X7orrDnjEYTI2i050H6TUE46yw7KNBtSAX2Ngzo=;
        b=FEtEGymk2QiPtPGIRkRzy9OZSvjtfJOLsfxJHxORFjr6E4zAWscx7jK/fklDIx5F3U
         5CWypRgNMsmsjb27T874JrhvShPZUxfX1M+CDcdBOr0el2YOrEz68fysSqXi4fl9L17T
         0w0QOqut1gf86FeXWzT182PQX/76wak1Aam7p1BGaRPmL7NmZFLCDdLUcXOq/KKccFSB
         /duZsyY+ggOIKT2PcOKDwjAv3nU30xvtZCIERHFbKhKwCicHNF1AxcD2RJHvaBbF769U
         HjwgmtHsjuauNjQRWc1XvwJ+teH8cEmrwAEPbXHVRIKTs3TSBHE1FxRJXRhQUabtesEp
         Lq0g==
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=Bvr0X7orrDnjEYTI2i050H6TUE46yw7KNBtSAX2Ngzo=;
        b=LQ6TIGakwnjQSUlGmSOaRZrohiDYMnJjzgYxZtWvvNS6s+z2Qe9s9emNyv1HNdKUgJ
         jLbk/9+c8vzuF2XWXi3LY7zSdZpg6A5s7pl+drKBJS19KQBFhU7qDf28uG102lMyV2qV
         ZA11elW0fSsKc7XeoFi/jqvlEv6TH+Oy55QtsBnIPrwPXkWml0HLxghV1gOYq/5HHTIe
         rHo0pYrexO4MyuWn3V7HGDs7LvTGsDC5X0ME9OBcurU+OrBrE2SRGWT8nUStrePCqWiO
         VQpV3NYWN4YtLdDp3+8SQYOwXLV8hYdEJboAcMVesYyxIQ8nbo0QxlIrQa83Uk32oxb9
         fjZw==
X-Gm-Message-State: AKaTC01EwKqsycIHgS7/AzuaSB2F1TdHUfXdZ/ftwjn83w5pjQK9ANvE4/XkeZn2ydxUDg==
X-Received: by 10.99.43.70 with SMTP id r67mr10132920pgr.15.1482186738662;
        Mon, 19 Dec 2016 14:32:18 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.40.91 with SMTP id h27ls13953787otd.44.gmail; Mon, 19 Dec
 2016 14:32:17 -0800 (PST)
X-Received: by 10.157.27.9 with SMTP id l9mr848666otl.6.1482186737931;
        Mon, 19 Dec 2016 14:32:17 -0800 (PST)
In-Reply-To: <cfe4e68c-9fc1-44fa-9b09-011b3bd15c2c@isocpp.org>
X-Original-Sender: rs2740@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:29942
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29942>

------=_Part_1273_1934345736.1482186737480
Content-Type: multipart/alternative; 
	boundary="----=_Part_1274_1964153039.1482186737480"

------=_Part_1274_1964153039.1482186737480
Content-Type: text/plain; charset=UTF-8

On Monday, December 19, 2016 at 4:33:34 PM UTC-5, Vittorio Romeo wrote:
>
> ...but according to the note the decltype((x)) inside l2_const's 
> compound-statement should refer to the outer `x`, not to the captured `x`.
> What's actually going on here? 
>
>
p20 and its special treatment for decltype((x)).


> I said that I was getting disheartened because achieving consistency 
> between lambda and classes results in a lot of breaking changes. I would be 
> surprised if there isn't any code out there in the real world that uses 
> `decltype` of a simple-capture in either the lambda-declarator or the 
> lambda's compound-expression: making the behavior consistent with classes 
> would change the meaning of all that code.
>
> Do you think it makes sense to keep going in this direction (i.e. total 
> consistency between lambdas with captures and classes)?
> On the other hand, the alternative option is focusing on making 
> init-captures accessible in the lambda-declarator, which would practically 
> introduce a "special case" for init-captures. It would lead to even more 
> inconsistency because:
> * Non-odr uses of simple-captures in the lambda-declarator would refer to 
> the "outer" object, not the capture itself.
> * Non-odr uses of init-captures in the lambda-declarator would refer to 
> the capture itself.
>
> Maybe what I really want is an alternative to the `this` keyword that 
> actually refers to the lambda itself...
> [x](decltype(x)) {} // refers to outer x
> [x](decltype(lambda->x)) {} // refers to captured x
>

`this`  is only available after the cv-qualifier-seq (or its lambda 
equivalent), but perhaps that's enough for 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/ec154f31-d0a7-4e4d-910b-87986be2d720%40isocpp.org.

------=_Part_1274_1964153039.1482186737480
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Monday, December 19, 2016 at 4:33:34 PM UTC-5, Vittorio=
 Romeo 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>...but according to the note the=C2=A0<span style=3D"font-size:small;f=
ont-family:monospace,monospace;white-space:pre;color:rgb(0,112,32);font-wei=
ght:bold">decltype</span><span style=3D"font-size:small;font-family:monospa=
ce,monospace;white-space:pre;color:rgb(0,0,0)">((x))</span>=C2=A0inside l2_=
const&#39;s compound-statement should refer to the outer `x`, not to the ca=
ptured `x`.<br>What&#39;s actually going on here?=C2=A0<br><br></div></div>=
</blockquote><div><br></div><div>p20 and its special treatment for decltype=
((x)).</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"margi=
n: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><di=
v dir=3D"ltr"><div><br>I said that I was getting disheartened because achie=
ving consistency between lambda and classes results in a lot of breaking ch=
anges. I would be surprised if there isn&#39;t any code out there in the re=
al world that uses `decltype` of a simple-capture in either the lambda-decl=
arator or the lambda&#39;s compound-expression: making the behavior consist=
ent with classes would change the meaning of all that code.</div><div><br><=
/div><div>Do you think it makes sense to keep going in this direction (i.e.=
 total consistency between lambdas with captures and classes)?<br>On the ot=
her hand, the alternative option is focusing on making init-captures access=
ible in the lambda-declarator, which would practically introduce a &quot;sp=
ecial case&quot; for init-captures. It would lead to even more inconsistenc=
y because:<br>* Non-odr uses of simple-captures in the lambda-declarator wo=
uld refer to the &quot;outer&quot; object, not the capture itself.<br>* Non=
-odr uses of init-captures in the lambda-declarator would refer to the capt=
ure itself.<br><br></div><div>Maybe what I really want is an alternative to=
 the `this` keyword that actually refers to the lambda itself...<br><span s=
tyle=3D"font-family:monospace;background-color:rgb(250,250,250);color:rgb(1=
02,102,0)">[</span><span style=3D"font-family:monospace;background-color:rg=
b(250,250,250);color:rgb(0,0,0)">x</span><span style=3D"font-family:monospa=
ce;background-color:rgb(250,250,250);color:rgb(102,102,0)">](</span><span s=
tyle=3D"font-family:monospace;background-color:rgb(250,250,250);color:rgb(0=
,0,136)">decltype</span><span style=3D"font-family:monospace;background-col=
or:rgb(250,250,250);color:rgb(102,102,0)">(</span><span style=3D"font-famil=
y:monospace;background-color:rgb(250,250,250);color:rgb(0,0,0)">x</span><sp=
an style=3D"font-family:monospace;background-color:rgb(250,250,250);color:r=
gb(102,102,0)">))</span><span style=3D"font-family:monospace;background-col=
or:rgb(250,250,250);color:rgb(0,0,0)">=C2=A0</span><span style=3D"font-fami=
ly:monospace;background-color:rgb(250,250,250);color:rgb(102,102,0)">{} // =
refers to outer x</span><br><div><span style=3D"font-family:monospace;backg=
round-color:rgb(250,250,250);color:rgb(102,102,0)">[</span><span style=3D"f=
ont-family:monospace;background-color:rgb(250,250,250);color:rgb(0,0,0)">x<=
/span><span style=3D"font-family:monospace;background-color:rgb(250,250,250=
);color:rgb(102,102,0)">](</span><span style=3D"font-family:monospace;backg=
round-color:rgb(250,250,250);color:rgb(0,0,136)">decltype</span><span style=
=3D"font-family:monospace;background-color:rgb(250,250,250);color:rgb(102,1=
02,0)">(lambda-&gt;</span><span style=3D"font-family:monospace;background-c=
olor:rgb(250,250,250);color:rgb(0,0,0)">x</span><span style=3D"font-family:=
monospace;background-color:rgb(250,250,250);color:rgb(102,102,0)">))</span>=
<span style=3D"font-family:monospace;background-color:rgb(250,250,250);colo=
r:rgb(0,0,0)">=C2=A0</span><span style=3D"font-family:monospace;background-=
color:rgb(250,250,250);color:rgb(102,102,0)">{} // refers to captured x</sp=
an></div></div></div></blockquote><div><br></div><div>`this` =C2=A0is only =
available after the cv-qualifier-seq=C2=A0(or its lambda equivalent), but p=
erhaps that&#39;s enough for this.</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/ec154f31-d0a7-4e4d-910b-87986be2d720%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/ec154f31-d0a7-4e4d-910b-87986be2d720=
%40isocpp.org</a>.<br />

------=_Part_1274_1964153039.1482186737480--

------=_Part_1273_1934345736.1482186737480--

.
