Topic: Lambda annotations


Author: Ritwik Das <ritwik.sami1990@gmail.com>
Date: Sun, 15 Apr 2018 00:28:42 -0700 (PDT)
Raw View
------=_Part_16649_844750235.1523777322869
Content-Type: multipart/alternative;
 boundary="----=_Part_16650_244734447.1523777322869"

------=_Part_16650_244734447.1523777322869
Content-Type: text/plain; charset="UTF-8"

Problem:
The fact that lambda functions are by design unnamed means that the
compiler has to assign names which show up in the call stack while
debugging and also in dumps etc. This makes things especially difficult for
automated tools which categorize dumps based on the call stack because the
compiler assigned lambda names tend to change over time. Some specific
problems which occur because of the compiler assigning random names to
lambda functions are cited below:

*Example 1:*
*Sample code:*
template<typename T>
int func(T&& lambda)
{
lambda();
}

int main()
{
func([]() {std::cout << "Hello!"; });
return 0;
}

*Compiler Error:*
1>lambda.cpp
1>\lambda.cpp(11): error C4716: 'func<<
*lambda_4653923a58ae9d647caab6ef4f61a443*> >': must return a value

Errors like this are hard to track because the error message does not
really identify the source of the problem.

*Example 2:*
> ClassA::frame6 C++
  ClassA::frame4::*__l62::<lambda>* C++
  ClassB::frame3<lambda>(void) > C++
  ClassA::frame2 C++
  ClassA::frame1 C++

In the above call stack, the lambda function is referred to as "__l62"
which neither is very useful nor does this stay invariant over time as more
lambdas are added to the codebase (it is not even clear how this name is
chosen by the compiler).

Proposal:
If there is a way for optionally annotating lambda functions with the
declaration, the compiler can use this to produce lambda names more
consistently. e.g. The strawman syntax can be something like: "[=]
*mylambda1*() {...}". This might seem counter-intuitive since lambdas are
defined to be *anonymous* functions, adding an optional annotation to the
lambda does not really take away the benefits of using lambdas over
functions but rather makes it more powerful.

P.S.:
Apologies if I missed proposals which addresses the above problem.

--
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/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org.

------=_Part_16650_244734447.1523777322869
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><font size=3D"4">Problem:</font><div>The fact that lambda =
functions are by design unnamed means that the compiler has to assign names=
 which show up in the call stack while debugging and also in dumps etc. Thi=
s makes things especially difficult for automated tools which categorize du=
mps based on the call stack because the compiler assigned lambda names tend=
 to change over time. Some specific problems which occur because of the com=
piler assigning random names to lambda functions are cited below:</div><div=
><br></div><div><b>Example 1:</b></div><div><u>Sample code:</u></div><div><=
div>template&lt;typename T&gt;</div><div>int func(T&amp;&amp; lambda)</div>=
<div>{</div><div><span style=3D"white-space:pre"> </span>lambda();</div><di=
v>}</div><div><br></div><div>int main()</div><div>{</div><div><span style=
=3D"white-space:pre"> </span>func([]() {std::cout &lt;&lt; &quot;Hello!&quo=
t;; });</div><div><span style=3D"white-space:pre"> </span>return 0;</div><d=
iv>}</div></div><div><br></div><div><u>Compiler Error:</u></div><div><div>1=
&gt;lambda.cpp</div><div>1&gt;\lambda.cpp(11): error C4716: &#39;func&lt;&l=
t;<b>lambda_4653923a58ae9d647caab6ef4f61a443</b>&gt; &gt;&#39;: must return=
 a value</div></div><div><br></div><div>Errors like this are hard to track =
because the error message does not really identify the source of the proble=
m.</div><div><br></div><div><b>Example 2:</b></div><div><div>&gt;<span styl=
e=3D"white-space:pre"> </span>ClassA::frame6<span style=3D"white-space:pre"=
> </span>C++</div><div>=C2=A0<span style=3D"white-space:pre"> </span>ClassA=
::frame4::<b>__l62::&lt;lambda&gt;</b><span style=3D"white-space:pre"> </sp=
an>C++</div><div>=C2=A0<span style=3D"white-space:pre"> </span>ClassB::fram=
e3&lt;lambda&gt;(void) &gt;<span style=3D"white-space:pre"> </span>C++</div=
><div>=C2=A0<span style=3D"white-space:pre"> </span>ClassA::frame2<span sty=
le=3D"white-space:pre"> </span>C++</div><div>=C2=A0<span style=3D"white-spa=
ce:pre"> </span>ClassA::frame1<span style=3D"white-space:pre"> </span>C++</=
div></div><div><br></div><div>In the above call stack, the lambda function =
is referred to as &quot;__l62&quot; which neither is very useful nor does t=
his stay invariant over time as more lambdas are added to the codebase (it =
is not even clear how this name is chosen by the compiler).</div><div><br><=
/div><div><font size=3D"4">Proposal:</font></div><div>If there is a way for=
 optionally annotating lambda functions with the declaration, the compiler =
can use this to produce lambda names more consistently. e.g. The strawman s=
yntax can be something like: &quot;[=3D] <b>mylambda1</b>() {...}&quot;. Th=
is might seem counter-intuitive since lambdas are defined to be <i>anonymou=
s</i> functions, adding an optional annotation to the lambda does not reall=
y take away the benefits of using lambdas over functions but rather makes i=
t more powerful.</div><div><br></div><div>P.S.:</div><div>Apologies if I mi=
ssed proposals which addresses the above problem.</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/5225897d-fa81-4137-928d-f97fcb4f2efe%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/5225897d-fa81-4137-928d-f97fcb4f2efe=
%40isocpp.org</a>.<br />

------=_Part_16650_244734447.1523777322869--

------=_Part_16649_844750235.1523777322869--

.


Author: Nicolas Lesser <blitzrakete@gmail.com>
Date: Sun, 15 Apr 2018 10:03:26 +0200
Raw View
--00000000000046c5fd0569de8a6b
Content-Type: text/plain; charset="UTF-8"

There was a proposal or idea once to name lambdas to be able to name the
lambda inside the lambda, and the syntax exactly matches what you propose.

Currently you can use an attribute :).

On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das <ritwik.sami1990@gmail.com>
wrote:

> Problem:
> The fact that lambda functions are by design unnamed means that the
> compiler has to assign names which show up in the call stack while
> debugging and also in dumps etc. This makes things especially difficult for
> automated tools which categorize dumps based on the call stack because the
> compiler assigned lambda names tend to change over time. Some specific
> problems which occur because of the compiler assigning random names to
> lambda functions are cited below:
>
> *Example 1:*
> *Sample code:*
> template<typename T>
> int func(T&& lambda)
> {
> lambda();
> }
>
> int main()
> {
> func([]() {std::cout << "Hello!"; });
> return 0;
> }
>
> *Compiler Error:*
> 1>lambda.cpp
> 1>\lambda.cpp(11): error C4716: 'func<<
> *lambda_4653923a58ae9d647caab6ef4f61a443*> >': must return a value
>
> Errors like this are hard to track because the error message does not
> really identify the source of the problem.
>
> *Example 2:*
> > ClassA::frame6 C++
>   ClassA::frame4::*__l62::<lambda>* C++
>   ClassB::frame3<lambda>(void) > C++
>   ClassA::frame2 C++
>   ClassA::frame1 C++
>
> In the above call stack, the lambda function is referred to as "__l62"
> which neither is very useful nor does this stay invariant over time as more
> lambdas are added to the codebase (it is not even clear how this name is
> chosen by the compiler).
>
> Proposal:
> If there is a way for optionally annotating lambda functions with the
> declaration, the compiler can use this to produce lambda names more
> consistently. e.g. The strawman syntax can be something like: "[=]
> *mylambda1*() {...}". This might seem counter-intuitive since lambdas are
> defined to be *anonymous* functions, adding an optional annotation to the
> lambda does not really take away the benefits of using lambdas over
> functions but rather makes it more powerful.
>
> P.S.:
> Apologies if I missed proposals which addresses the above problem.
>
> --
> 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/5225897d-fa81-4137-
> 928d-f97fcb4f2efe%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>

--
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/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com.

--00000000000046c5fd0569de8a6b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">There was a proposal or idea once to name lambdas to be ab=
le to name the lambda inside the lambda, and the syntax exactly matches wha=
t you propose.<div><br></div><div>Currently you can use an attribute :).</d=
iv></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Sun, =
Apr 15, 2018 at 9:28 AM, Ritwik Das <span dir=3D"ltr">&lt;<a href=3D"mailto=
:ritwik.sami1990@gmail.com" target=3D"_blank">ritwik.sami1990@gmail.com</a>=
&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0=
 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><font=
 size=3D"4">Problem:</font><div>The fact that lambda functions are by desig=
n unnamed means that the compiler has to assign names which show up in the =
call stack while debugging and also in dumps etc. This makes things especia=
lly difficult for automated tools which categorize dumps based on the call =
stack because the compiler assigned lambda names tend to change over time. =
Some specific problems which occur because of the compiler assigning random=
 names to lambda functions are cited below:</div><div><br></div><div><b>Exa=
mple 1:</b></div><div><u>Sample code:</u></div><div><div>template&lt;typena=
me T&gt;</div><div>int func(T&amp;&amp; lambda)</div><div>{</div><div><span=
 style=3D"white-space:pre-wrap"> </span>lambda();</div><div>}</div><div><br=
></div><div>int main()</div><div>{</div><div><span style=3D"white-space:pre=
-wrap"> </span>func([]() {std::cout &lt;&lt; &quot;Hello!&quot;; });</div><=
div><span style=3D"white-space:pre-wrap"> </span>return 0;</div><div>}</div=
></div><div><br></div><div><u>Compiler Error:</u></div><div><div>1&gt;lambd=
a.cpp</div><div>1&gt;\lambda.cpp(11): error C4716: &#39;func&lt;&lt;<b>lamb=
da_<wbr>4653923a58ae9d647caab6ef4f61a4<wbr>43</b>&gt; &gt;&#39;: must retur=
n a value</div></div><div><br></div><div>Errors like this are hard to track=
 because the error message does not really identify the source of the probl=
em.</div><div><br></div><div><b>Example 2:</b></div><div><div>&gt;<span sty=
le=3D"white-space:pre-wrap"> </span>ClassA::frame6<span style=3D"white-spac=
e:pre-wrap"> </span>C++</div><div>=C2=A0<span style=3D"white-space:pre-wrap=
"> </span>ClassA::frame4::<b>__l62::&lt;<wbr>lambda&gt;</b><span style=3D"w=
hite-space:pre-wrap"> </span>C++</div><div>=C2=A0<span style=3D"white-space=
:pre-wrap"> </span>ClassB::frame3&lt;lambda&gt;(void) &gt;<span style=3D"wh=
ite-space:pre-wrap"> </span>C++</div><div>=C2=A0<span style=3D"white-space:=
pre-wrap"> </span>ClassA::frame2<span style=3D"white-space:pre-wrap"> </spa=
n>C++</div><div>=C2=A0<span style=3D"white-space:pre-wrap"> </span>ClassA::=
frame1<span style=3D"white-space:pre-wrap"> </span>C++</div></div><div><br>=
</div><div>In the above call stack, the lambda function is referred to as &=
quot;__l62&quot; which neither is very useful nor does this stay invariant =
over time as more lambdas are added to the codebase (it is not even clear h=
ow this name is chosen by the compiler).</div><div><br></div><div><font siz=
e=3D"4">Proposal:</font></div><div>If there is a way for optionally annotat=
ing lambda functions with the declaration, the compiler can use this to pro=
duce lambda names more consistently. e.g. The strawman syntax can be someth=
ing like: &quot;[=3D] <b>mylambda1</b>() {...}&quot;. This might seem count=
er-intuitive since lambdas are defined to be <i>anonymous</i> functions, ad=
ding an optional annotation to the lambda does not really take away the ben=
efits of using lambdas over functions but rather makes it more powerful.</d=
iv><div><br></div><div>P.S.:</div><div>Apologies if I missed proposals whic=
h addresses the above problem.</div></div><span class=3D"HOEnZb"><font colo=
r=3D"#888888">

<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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">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/5225897d-fa81-4137-928d-f97fcb4f2efe%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/5225=
897d-fa81-4137-<wbr>928d-f97fcb4f2efe%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div><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/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7=
DLVof0h%2BJ0jjVgMw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq2sdDK0=
5--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com</a>.<br />

--00000000000046c5fd0569de8a6b--

.


Author: Ritwik Das <ritwik.sami1990@gmail.com>
Date: Sun, 15 Apr 2018 08:28:01 -0700
Raw View
--_216B2E7A-A6F1-4844-9109-1591D9A9C0C7_
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

But I am still confused how attributes can solve the problems mentioned bel=
ow?

Sent from Mail for Windows 10

From: Nicolas Lesser
Sent: Sunday, April 15, 2018 1:03 AM
To: std-proposals@isocpp.org
Subject: Re: [std-proposals] Lambda annotations

There was a proposal or idea once to name lambdas to be able to name the la=
mbda inside the lambda, and the syntax exactly matches what you propose.

Currently you can use an attribute :).

On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das <ritwik.sami1990@gmail.com> wro=
te:
Problem:
The fact that lambda functions are by design unnamed means that the compile=
r has to assign names which show up in the call stack while debugging and a=
lso in dumps etc. This makes things especially difficult for automated tool=
s which categorize dumps based on the call stack because the compiler assig=
ned lambda names tend to change over time. Some specific problems which occ=
ur because of the compiler assigning random names to lambda functions are c=
ited below:

Example 1:
Sample code:
template<typename T>
int func(T&& lambda)
{
lambda();
}

int main()
{
func([]() {std::cout << "Hello!"; });
return 0;
}

Compiler Error:
1>lambda.cpp
1>\lambda.cpp(11): error C4716: 'func<<lambda_4653923a58ae9d647caab6ef4f61a=
443> >': must return a value

Errors like this are hard to track because the error message does not reall=
y identify the source of the problem.

Example 2:
> ClassA::frame6 C++
=C2=A0 ClassA::frame4::__l62::<lambda> C++
=C2=A0 ClassB::frame3<lambda>(void) > C++
=C2=A0 ClassA::frame2 C++
=C2=A0 ClassA::frame1 C++

In the above call stack, the lambda function is referred to as "__l62" whic=
h neither is very useful nor does this stay invariant over time as more lam=
bdas are added to the codebase (it is not even clear how this name is chose=
n by the compiler).

Proposal:
If there is a way for optionally annotating lambda functions with the decla=
ration, the compiler can use this to produce lambda names more consistently=
.. e.g. The strawman syntax can be something like: "[=3D] mylambda1() {...}"=
.. This might seem counter-intuitive since lambdas are defined to be anonymo=
us functions, adding an optional annotation to the lambda does not really t=
ake away the benefits of using lambdas over functions but rather makes it m=
ore powerful.

P.S.:
Apologies if I missed proposals which addresses the above problem.
--=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/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.or=
g.

--=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/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ=
0jjVgMw%40mail.gmail.com.

--=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/5ad36f81.c614620a.ddf08.2250%40mx.google.com.

--_216B2E7A-A6F1-4844-9109-1591D9A9C0C7_
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="UTF-8"

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:sc=
hemas-microsoft-com:office:word" xmlns:m=3D"http://schemas.microsoft.com/of=
fice/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta ht=
tp-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8"><meta name=
=3DGenerator content=3D"Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
 {font-family:"Cambria Math";
 panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
 {font-family:Calibri;
 panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
 {margin:0in;
 margin-bottom:.0001pt;
 font-size:11.0pt;
 font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
 {mso-style-priority:99;
 color:blue;
 text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
 {mso-style-priority:99;
 color:#954F72;
 text-decoration:underline;}
span.hoenzb
 {mso-style-name:hoenzb;}
..MsoChpDefault
 {mso-style-type:export-only;}
@page WordSection1
 {size:8.5in 11.0in;
 margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
 {page:WordSection1;}
--></style></head><body lang=3DEN-US link=3Dblue vlink=3D"#954F72"><div cla=
ss=3DWordSection1><p class=3DMsoNormal>But I am still confused how attribut=
es can solve the problems mentioned below?</p><p class=3DMsoNormal><o:p>&nb=
sp;</o:p></p><p class=3DMsoNormal>Sent from <a href=3D"https://go.microsoft=
..com/fwlink/?LinkId=3D550986">Mail</a> for Windows 10</p><p class=3DMsoNorm=
al><o:p>&nbsp;</o:p></p><div style=3D'mso-element:para-border-div;border:no=
ne;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=3DMso=
Normal style=3D'border:none;padding:0in'><b>From: </b><a href=3D"mailto:bli=
tzrakete@gmail.com">Nicolas Lesser</a><br><b>Sent: </b>Sunday, April 15, 20=
18 1:03 AM<br><b>To: </b><a href=3D"mailto:std-proposals@isocpp.org">std-pr=
oposals@isocpp.org</a><br><b>Subject: </b>Re: [std-proposals] Lambda annota=
tions</p></div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><p class=3DMs=
oNormal>There was a proposal or idea once to name lambdas to be able to nam=
e the lambda inside the lambda, and the syntax exactly matches what you pro=
pose.</p><div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=
=3DMsoNormal>Currently you can use an attribute :).</p></div></div><div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><p class=3DMsoNormal>On Sun, Ap=
r 15, 2018 at 9:28 AM, Ritwik Das &lt;<a href=3D"mailto:ritwik.sami1990@gma=
il.com" target=3D"_blank">ritwik.sami1990@gmail.com</a>&gt; wrote:</p><bloc=
kquote style=3D'border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in=
 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><p class=3DMsoNormal><s=
pan style=3D'font-size:13.5pt'>Problem:</span></p><div><p class=3DMsoNormal=
>The fact that lambda functions are by design unnamed means that the compil=
er has to assign names which show up in the call stack while debugging and =
also in dumps etc. This makes things especially difficult for automated too=
ls which categorize dumps based on the call stack because the compiler assi=
gned lambda names tend to change over time. Some specific problems which oc=
cur because of the compiler assigning random names to lambda functions are =
cited below:</p></div><div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div>=
<div><p class=3DMsoNormal><b>Example 1:</b></p></div><div><p class=3DMsoNor=
mal><u>Sample code:</u></p></div><div><div><p class=3DMsoNormal>template&lt=
;typename T&gt;</p></div><div><p class=3DMsoNormal>int func(T&amp;&amp; lam=
bda)</p></div><div><p class=3DMsoNormal>{</p></div><div><p class=3DMsoNorma=
l>lambda();</p></div><div><p class=3DMsoNormal>}</p></div><div><p class=3DM=
soNormal><o:p>&nbsp;</o:p></p></div><div><p class=3DMsoNormal>int main()</p=
></div><div><p class=3DMsoNormal>{</p></div><div><p class=3DMsoNormal>func(=
[]() {std::cout &lt;&lt; &quot;Hello!&quot;; });</p></div><div><p class=3DM=
soNormal>return 0;</p></div><div><p class=3DMsoNormal>}</p></div></div><div=
><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=3DMsoNormal>=
<u>Compiler Error:</u></p></div><div><div><p class=3DMsoNormal>1&gt;lambda.=
cpp</p></div><div><p class=3DMsoNormal>1&gt;\lambda.cpp(11): error C4716: '=
func&lt;&lt;<b>lambda_4653923a58ae9d647caab6ef4f61a443</b>&gt; &gt;': must =
return a value</p></div></div><div><p class=3DMsoNormal><o:p>&nbsp;</o:p></=
p></div><div><p class=3DMsoNormal>Errors like this are hard to track becaus=
e the error message does not really identify the source of the problem.</p>=
</div><div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=3D=
MsoNormal><b>Example 2:</b></p></div><div><div><p class=3DMsoNormal>&gt; Cl=
assA::frame6 C++</p></div><div><p class=3DMsoNormal>&nbsp; ClassA::frame4::=
<b>__l62::&lt;lambda&gt;</b> C++</p></div><div><p class=3DMsoNormal>&nbsp; =
ClassB::frame3&lt;lambda&gt;(void) &gt; C++</p></div><div><p class=3DMsoNor=
mal>&nbsp; ClassA::frame2 C++</p></div><div><p class=3DMsoNormal>&nbsp; Cla=
ssA::frame1 C++</p></div></div><div><p class=3DMsoNormal><o:p>&nbsp;</o:p><=
/p></div><div><p class=3DMsoNormal>In the above call stack, the lambda func=
tion is referred to as &quot;__l62&quot; which neither is very useful nor d=
oes this stay invariant over time as more lambdas are added to the codebase=
 (it is not even clear how this name is chosen by the compiler).</p></div><=
div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=3DMsoNorm=
al><span style=3D'font-size:13.5pt'>Proposal:</span></p></div><div><p class=
=3DMsoNormal>If there is a way for optionally annotating lambda functions w=
ith the declaration, the compiler can use this to produce lambda names more=
 consistently. e.g. The strawman syntax can be something like: &quot;[=3D] =
<b>mylambda1</b>() {...}&quot;. This might seem counter-intuitive since lam=
bdas are defined to be <i>anonymous</i> functions, adding an optional annot=
ation to the lambda does not really take away the benefits of using lambdas=
 over functions but rather makes it more powerful.</p></div><div><p class=
=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=3DMsoNormal>P.S.:</p>=
</div><div><p class=3DMsoNormal>Apologies if I missed proposals which addre=
sses the above problem.</p></div></div><p class=3DMsoNormal><span class=3Dh=
oenzb><span style=3D'color:#888888'>-- </span></span><span style=3D'color:#=
888888'><br><span class=3Dhoenzb>You received this message because you are =
subscribed to the Google Groups &quot;ISO C++ Standard - Future Proposals&q=
uot; group.</span><br><span class=3Dhoenzb>To unsubscribe from this group a=
nd stop receiving emails from it, send an email to <a href=3D"mailto:std-pr=
oposals+unsubscribe@isocpp.org" target=3D"_blank">std-proposals+unsubscribe=
@isocpp.org</a>.</span><br><span class=3Dhoenzb>To post to this group, send=
 email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std=
-proposals@isocpp.org</a>.</span><br><span class=3Dhoenzb>To view this disc=
ussion on the web visit <a href=3D"https://groups.google.com/a/isocpp.org/d=
/msgid/std-proposals/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_=
medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">https://groups.go=
ogle.com/a/isocpp.org/d/msgid/std-proposals/5225897d-fa81-4137-928d-f97fcb4=
f2efe%40isocpp.org</a>.</span></span></p></blockquote></div><p class=3DMsoN=
ormal><o:p>&nbsp;</o:p></p></div><p class=3DMsoNormal>-- <br>You received t=
his message because you are subscribed to the Google Groups &quot;ISO C++ S=
tandard - Future Proposals&quot; group.<br>To unsubscribe from this group a=
nd stop receiving emails from it, send an email to <a href=3D"mailto:std-pr=
oposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<b=
r>To post to this group, send email to <a href=3D"mailto:std-proposals@isoc=
pp.org">std-proposals@isocpp.org</a>.<br>To view this discussion on the web=
 visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-propos=
als/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.co=
m?utm_medium=3Demail&amp;utm_source=3Dfooter">https://groups.google.com/a/i=
socpp.org/d/msgid/std-proposals/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0=
h%2BJ0jjVgMw%40mail.gmail.com</a>.</p><p class=3DMsoNormal><o:p>&nbsp;</o:p=
></p></div></body></html>

<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/5ad36f81.c614620a.ddf08.2250%40mx.goo=
gle.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/a=
/isocpp.org/d/msgid/std-proposals/5ad36f81.c614620a.ddf08.2250%40mx.google.=
com</a>.<br />

--_216B2E7A-A6F1-4844-9109-1591D9A9C0C7_--


.


Author: Nicolas Lesser <blitzrakete@gmail.com>
Date: Sun, 15 Apr 2018 17:50:07 +0200
Raw View
--00000000000042ee6c0569e50fe5
Content-Type: text/plain; charset="UTF-8"

Well, you could use either a new attribute or an implementation-defined
attribute to give the lambda a name for debugging/error reporting purposes.

On Sun, Apr 15, 2018 at 5:28 PM, Ritwik Das <ritwik.sami1990@gmail.com>
wrote:

> But I am still confused how attributes can solve the problems mentioned
> below?
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> *From: *Nicolas Lesser <blitzrakete@gmail.com>
> *Sent: *Sunday, April 15, 2018 1:03 AM
> *To: *std-proposals@isocpp.org
> *Subject: *Re: [std-proposals] Lambda annotations
>
>
>
> There was a proposal or idea once to name lambdas to be able to name the
> lambda inside the lambda, and the syntax exactly matches what you propose.
>
>
>
> Currently you can use an attribute :).
>
>
>
> On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das <ritwik.sami1990@gmail.com>
> wrote:
>
> Problem:
>
> The fact that lambda functions are by design unnamed means that the
> compiler has to assign names which show up in the call stack while
> debugging and also in dumps etc. This makes things especially difficult for
> automated tools which categorize dumps based on the call stack because the
> compiler assigned lambda names tend to change over time. Some specific
> problems which occur because of the compiler assigning random names to
> lambda functions are cited below:
>
>
>
> *Example 1:*
>
> *Sample code:*
>
> template<typename T>
>
> int func(T&& lambda)
>
> {
>
> lambda();
>
> }
>
>
>
> int main()
>
> {
>
> func([]() {std::cout << "Hello!"; });
>
> return 0;
>
> }
>
>
>
> *Compiler Error:*
>
> 1>lambda.cpp
>
> 1>\lambda.cpp(11): error C4716: 'func<<
> *lambda_4653923a58ae9d647caab6ef4f61a443*> >': must return a value
>
>
>
> Errors like this are hard to track because the error message does not
> really identify the source of the problem.
>
>
>
> *Example 2:*
>
> > ClassA::frame6 C++
>
>   ClassA::frame4::*__l62::<lambda>* C++
>
>   ClassB::frame3<lambda>(void) > C++
>
>   ClassA::frame2 C++
>
>   ClassA::frame1 C++
>
>
>
> In the above call stack, the lambda function is referred to as "__l62"
> which neither is very useful nor does this stay invariant over time as more
> lambdas are added to the codebase (it is not even clear how this name is
> chosen by the compiler).
>
>
>
> Proposal:
>
> If there is a way for optionally annotating lambda functions with the
> declaration, the compiler can use this to produce lambda names more
> consistently. e.g. The strawman syntax can be something like: "[=]
> *mylambda1*() {...}". This might seem counter-intuitive since lambdas are
> defined to be *anonymous* functions, adding an optional annotation to the
> lambda does not really take away the benefits of using lambdas over
> functions but rather makes it more powerful.
>
>
>
> P.S.:
>
> Apologies if I missed proposals which addresses the above problem.
>
> --
> 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/5225897d-fa81-4137-
> 928d-f97fcb4f2efe%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
>
>
> --
> 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/CALmDwq2sdDK05--
> 85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>
>
> --
> 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/5ad36f81.c614620a.
> ddf08.2250%40mx.google.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad36f81.c614620a.ddf08.2250%40mx.google.com?utm_medium=email&utm_source=footer>
> .
>

--
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/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com.

--00000000000042ee6c0569e50fe5
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Well, you could use either a new attribute or an implement=
ation-defined attribute to give the lambda a name for debugging/error repor=
ting purposes.</div><div class=3D"gmail_extra"><br><div class=3D"gmail_quot=
e">On Sun, Apr 15, 2018 at 5:28 PM, Ritwik Das <span dir=3D"ltr">&lt;<a hre=
f=3D"mailto:ritwik.sami1990@gmail.com" target=3D"_blank">ritwik.sami1990@gm=
ail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D=
"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang=
=3D"EN-US" link=3D"blue" vlink=3D"#954F72"><div class=3D"m_4195605197699100=
460WordSection1"><p class=3D"MsoNormal">But I am still confused how attribu=
tes can solve the problems mentioned below?</p><p class=3D"MsoNormal"><u></=
u>=C2=A0<u></u></p><p class=3D"MsoNormal">Sent from <a href=3D"https://go.m=
icrosoft.com/fwlink/?LinkId=3D550986" target=3D"_blank">Mail</a> for Window=
s 10</p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><div style=3D"border=
:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class=3D=
"MsoNormal" style=3D"border:none;padding:0in"><b>From: </b><a href=3D"mailt=
o:blitzrakete@gmail.com" target=3D"_blank">Nicolas Lesser</a><br><b>Sent: <=
/b>Sunday, April 15, 2018 1:03 AM<br><b>To: </b><a href=3D"mailto:std-propo=
sals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a><br><b>Subje=
ct: </b>Re: [std-proposals] Lambda annotations</p></div><div><div class=3D"=
h5"><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><div><p class=3D"MsoNorm=
al">There was a proposal or idea once to name lambdas to be able to name th=
e lambda inside the lambda, and the syntax exactly matches what you propose=
..</p><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p clas=
s=3D"MsoNormal">Currently you can use an attribute :).</p></div></div><div>=
<p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><div><p class=3D"MsoNormal">=
On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das &lt;<a href=3D"mailto:ritwik.sa=
mi1990@gmail.com" target=3D"_blank">ritwik.sami1990@gmail.com</a>&gt; wrote=
:</p><blockquote style=3D"border:none;border-left:solid #cccccc 1.0pt;paddi=
ng:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"><div><p class=3D"M=
soNormal"><span style=3D"font-size:13.5pt">Problem:</span></p><div><p class=
=3D"MsoNormal">The fact that lambda functions are by design unnamed means t=
hat the compiler has to assign names which show up in the call stack while =
debugging and also in dumps etc. This makes things especially difficult for=
 automated tools which categorize dumps based on the call stack because the=
 compiler assigned lambda names tend to change over time. Some specific pro=
blems which occur because of the compiler assigning random names to lambda =
functions are cited below:</p></div><div><p class=3D"MsoNormal"><u></u>=C2=
=A0<u></u></p></div><div><p class=3D"MsoNormal"><b>Example 1:</b></p></div>=
<div><p class=3D"MsoNormal"><u>Sample code:</u></p></div><div><div><p class=
=3D"MsoNormal">template&lt;typename T&gt;</p></div><div><p class=3D"MsoNorm=
al">int func(T&amp;&amp; lambda)</p></div><div><p class=3D"MsoNormal">{</p>=
</div><div><p class=3D"MsoNormal">lambda();</p></div><div><p class=3D"MsoNo=
rmal">}</p></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div>=
<div><p class=3D"MsoNormal">int main()</p></div><div><p class=3D"MsoNormal"=
>{</p></div><div><p class=3D"MsoNormal">func([]() {std::cout &lt;&lt; &quot=
;Hello!&quot;; });</p></div><div><p class=3D"MsoNormal">return 0;</p></div>=
<div><p class=3D"MsoNormal">}</p></div></div><div><p class=3D"MsoNormal"><u=
></u>=C2=A0<u></u></p></div><div><p class=3D"MsoNormal"><u>Compiler Error:<=
/u></p></div><div><div><p class=3D"MsoNormal">1&gt;lambda.cpp</p></div><div=
><p class=3D"MsoNormal">1&gt;\lambda.cpp(11): error C4716: &#39;func&lt;&lt=
;<b>lambda_<wbr>4653923a58ae9d647caab6ef4f61a4<wbr>43</b>&gt; &gt;&#39;: mu=
st return a value</p></div></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<=
u></u></p></div><div><p class=3D"MsoNormal">Errors like this are hard to tr=
ack because the error message does not really identify the source of the pr=
oblem.</p></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><=
div><p class=3D"MsoNormal"><b>Example 2:</b></p></div><div><div><p class=3D=
"MsoNormal">&gt; ClassA::frame6 C++</p></div><div><p class=3D"MsoNormal">=
=C2=A0 ClassA::frame4::<b>__l62::&lt;<wbr>lambda&gt;</b> C++</p></div><div>=
<p class=3D"MsoNormal">=C2=A0 ClassB::frame3&lt;lambda&gt;(void) &gt; C++</=
p></div><div><p class=3D"MsoNormal">=C2=A0 ClassA::frame2 C++</p></div><div=
><p class=3D"MsoNormal">=C2=A0 ClassA::frame1 C++</p></div></div><div><p cl=
ass=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"MsoNormal"=
>In the above call stack, the lambda function is referred to as &quot;__l62=
&quot; which neither is very useful nor does this stay invariant over time =
as more lambdas are added to the codebase (it is not even clear how this na=
me is chosen by the compiler).</p></div><div><p class=3D"MsoNormal"><u></u>=
=C2=A0<u></u></p></div><div><p class=3D"MsoNormal"><span style=3D"font-size=
:13.5pt">Proposal:</span></p></div><div><p class=3D"MsoNormal">If there is =
a way for optionally annotating lambda functions with the declaration, the =
compiler can use this to produce lambda names more consistently. e.g. The s=
trawman syntax can be something like: &quot;[=3D] <b>mylambda1</b>() {...}&=
quot;. This might seem counter-intuitive since lambdas are defined to be <i=
>anonymous</i> functions, adding an optional annotation to the lambda does =
not really take away the benefits of using lambdas over functions but rathe=
r makes it more powerful.</p></div><div><p class=3D"MsoNormal"><u></u>=C2=
=A0<u></u></p></div><div><p class=3D"MsoNormal">P.S.:</p></div><div><p clas=
s=3D"MsoNormal">Apologies if I missed proposals which addresses the above p=
roblem.</p></div></div><p class=3D"MsoNormal"><span class=3D"m_419560519769=
9100460hoenzb"><span style=3D"color:#888888">-- </span></span><span style=
=3D"color:#888888"><br><span class=3D"m_4195605197699100460hoenzb">You rece=
ived this message because you are subscribed to the Google Groups &quot;ISO=
 C++ Standard - Future Proposals&quot; group.</span><br><span class=3D"m_41=
95605197699100460hoenzb">To unsubscribe from this group and stop receiving =
emails from it, send an email to <a href=3D"mailto:std-proposals+unsubscrib=
e@isocpp.org" target=3D"_blank">std-proposals+unsubscribe@<wbr>isocpp.org</=
a>.</span><br><span class=3D"m_4195605197699100460hoenzb">To post to this g=
roup, send email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_=
blank">std-proposals@isocpp.org</a>.</span><br><span class=3D"m_41956051976=
99100460hoenzb">To view this discussion on the web visit <a href=3D"https:/=
/groups.google.com/a/isocpp.org/d/msgid/std-proposals/5225897d-fa81-4137-92=
8d-f97fcb4f2efe%40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" ta=
rget=3D"_blank">https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wb=
r>proposals/5225897d-fa81-4137-<wbr>928d-f97fcb4f2efe%40isocpp.org</a><wbr>=
..</span></span></p></blockquote></div><p class=3D"MsoNormal"><u></u>=C2=A0<=
u></u></p></div></div></div><p class=3D"MsoNormal"></p><div><div class=3D"h=
5">-- <br>You received this message because you are subscribed to the Googl=
e Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br>To unsub=
scribe from this group and stop receiving emails from it, send an email to =
<a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank">s=
td-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>To post to this group, sen=
d email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">st=
d-proposals@isocpp.org</a>.<br></div></div>To view this discussion on the w=
eb visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-prop=
osals/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.=
com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">https://g=
roups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/CALmDwq2sdDK0=
5--<wbr>85eo%3DeNRceVjqRA1-W7DLVof0h%<wbr>2BJ0jjVgMw%40mail.gmail.com</a>.<=
p></p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div></div><span clas=
s=3D"">

<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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/5ad36f81.c614620a.ddf08.2250%40mx.goo=
gle.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">https=
://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/5ad36f81.=
c614620a.<wbr>ddf08.2250%40mx.google.com</a>.<br>
</blockquote></div><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/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf=
6AQaQPB%2ByLiz1oJg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq1oGuP3=
Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com</a>.<br />

--00000000000042ee6c0569e50fe5--

.


Author: Ritwik Das <ritwik.sami1990@gmail.com>
Date: Sun, 15 Apr 2018 09:14:22 -0700
Raw View
--_A022973E-5E6C-4E96-94F4-E78AA3573916_
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

Standard attributes/implementation specific attributes do not help much in =
this case but new attributes do not affect the compiler generated names I w=
ould want symbols to be generated based on the given names. I tried somethi=
ng like this but the names are random regardless. What am I missing?

#include <iostream>

template<typename T>
void func(T&& lambda)
{
=C2=A0=C2=A0=C2=A0=C2=A0lambda();
}

int main()
{
=C2=A0=C2=A0=C2=A0=C2=A0func([]()[[cats::meow]] {std::cout << "Hello!"; });
=C2=A0=C2=A0=C2=A0=C2=A0func([]() {std::cout << "world!"; });
=C2=A0=C2=A0=C2=A0=C2=A0return 0;
}



Sent from Mail for Windows 10

From: Nicolas Lesser
Sent: Sunday, April 15, 2018 8:50 AM
To: std-proposals@isocpp.org
Subject: Re: [std-proposals] Lambda annotations

Well, you could use either a new attribute or an implementation-defined att=
ribute to give the lambda a name for debugging/error reporting purposes.

On Sun, Apr 15, 2018 at 5:28 PM, Ritwik Das <ritwik.sami1990@gmail.com> wro=
te:
But I am still confused how attributes can solve the problems mentioned bel=
ow?
=C2=A0
Sent from Mail for Windows 10
=C2=A0
From: Nicolas Lesser
Sent: Sunday, April 15, 2018 1:03 AM
To: std-proposals@isocpp.org
Subject: Re: [std-proposals] Lambda annotations
=C2=A0
There was a proposal or idea once to name lambdas to be able to name the la=
mbda inside the lambda, and the syntax exactly matches what you propose.
=C2=A0
Currently you can use an attribute :).
=C2=A0
On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das <ritwik.sami1990@gmail.com> wro=
te:
Problem:
The fact that lambda functions are by design unnamed means that the compile=
r has to assign names which show up in the call stack while debugging and a=
lso in dumps etc. This makes things especially difficult for automated tool=
s which categorize dumps based on the call stack because the compiler assig=
ned lambda names tend to change over time. Some specific problems which occ=
ur because of the compiler assigning random names to lambda functions are c=
ited below:
=C2=A0
Example 1:
Sample code:
template<typename T>
int func(T&& lambda)
{
lambda();
}
=C2=A0
int main()
{
func([]() {std::cout << "Hello!"; });
return 0;
}
=C2=A0
Compiler Error:
1>lambda.cpp
1>\lambda.cpp(11): error C4716: 'func<<lambda_4653923a58ae9d647caab6ef4f61a=
443> >': must return a value
=C2=A0
Errors like this are hard to track because the error message does not reall=
y identify the source of the problem.
=C2=A0
Example 2:
> ClassA::frame6 C++
=C2=A0 ClassA::frame4::__l62::<lambda> C++
=C2=A0 ClassB::frame3<lambda>(void) > C++
=C2=A0 ClassA::frame2 C++
=C2=A0 ClassA::frame1 C++
=C2=A0
In the above call stack, the lambda function is referred to as "__l62" whic=
h neither is very useful nor does this stay invariant over time as more lam=
bdas are added to the codebase (it is not even clear how this name is chose=
n by the compiler).
=C2=A0
Proposal:
If there is a way for optionally annotating lambda functions with the decla=
ration, the compiler can use this to produce lambda names more consistently=
.. e.g. The strawman syntax can be something like: "[=3D] mylambda1() {...}"=
.. This might seem counter-intuitive since lambdas are defined to be anonymo=
us functions, adding an optional annotation to the lambda does not really t=
ake away the benefits of using lambdas over functions but rather makes it m=
ore powerful.
=C2=A0
P.S.:
Apologies if I missed proposals which addresses the above problem.
--=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/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.or=
g.
=C2=A0
--=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/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ=
0jjVgMw%40mail.gmail.com.
=C2=A0
--=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/5ad36f81.c614620a.ddf08.2250%40mx.google.com.

--=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/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2By=
Liz1oJg%40mail.gmail.com.

--=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/5ad37a5f.d164650a.b857a.760b%40mx.google.com.

--_A022973E-5E6C-4E96-94F4-E78AA3573916_
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="UTF-8"

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:sc=
hemas-microsoft-com:office:word" xmlns:m=3D"http://schemas.microsoft.com/of=
fice/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta ht=
tp-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8"><meta name=
=3DGenerator content=3D"Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
 {font-family:"Cambria Math";
 panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
 {font-family:Calibri;
 panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
 {margin:0in;
 margin-bottom:.0001pt;
 font-size:11.0pt;
 font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
 {mso-style-priority:99;
 color:blue;
 text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
 {mso-style-priority:99;
 color:#954F72;
 text-decoration:underline;}
span.m4195605197699100460hoenzb
 {mso-style-name:m_4195605197699100460hoenzb;}
..MsoChpDefault
 {mso-style-type:export-only;}
@page WordSection1
 {size:8.5in 11.0in;
 margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
 {page:WordSection1;}
--></style></head><body lang=3DEN-US link=3Dblue vlink=3D"#954F72"><div cla=
ss=3DWordSection1><p class=3DMsoNormal>Standard attributes/implementation s=
pecific attributes do not help much in this case but new attributes do not =
affect the compiler generated names I would want symbols to be generated ba=
sed on the given names. I tried something like this but the names are rando=
m regardless. What am I missing?</p><p class=3DMsoNormal><o:p>&nbsp;</o:p><=
/p><div><div><div><p class=3DMsoNormal><span style=3D'color:blue'>#include<=
/span><span style=3D'color:black'> &lt;iostream&gt;</span><o:p></o:p></p></=
div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><p class=3DMsoNormal><sp=
an style=3D'color:blue'>template</span><span style=3D'color:black'>&lt;</sp=
an><span style=3D'color:blue'>typename</span><span style=3D'color:black'> T=
&gt;</span><o:p></o:p></p></div><div><p class=3DMsoNormal><span style=3D'co=
lor:blue'>void</span><span style=3D'color:black'> func(T&amp;&amp; lambda)<=
/span><o:p></o:p></p></div><div><p class=3DMsoNormal><span style=3D'color:b=
lack'>{</span><o:p></o:p></p></div><div><p class=3DMsoNormal><span style=3D=
'color:black'>&nbsp;&nbsp;&nbsp;&nbsp;lambda();</span><o:p></o:p></p></div>=
<div><p class=3DMsoNormal><span style=3D'color:black'>}</span><o:p></o:p></=
p></div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><p class=3DMsoNormal=
><span style=3D'color:blue'>int</span><span style=3D'color:black'> main()</=
span><o:p></o:p></p></div><div><p class=3DMsoNormal><span style=3D'color:bl=
ack'>{</span><o:p></o:p></p></div><div><p class=3DMsoNormal><span style=3D'=
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;func([]()</span><span style=3D'color:g=
ray'>[[cats::meow]]</span><span style=3D'color:black'> {std::cout &lt;&lt; =
</span><span style=3D'color:#A31515'>&quot;Hello!&quot;</span><span style=
=3D'color:black'>; });</span><o:p></o:p></p></div><div><p class=3DMsoNormal=
><span style=3D'color:black'>&nbsp;&nbsp;&nbsp;&nbsp;func([]() {std::cout &=
lt;&lt; </span><span style=3D'color:#A31515'>&quot;world!&quot;</span><span=
 style=3D'color:black'>; });</span><o:p></o:p></p></div><div><p class=3DMso=
Normal><span style=3D'color:black'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span sty=
le=3D'color:blue'>return</span><span style=3D'color:black'> </span><span st=
yle=3D'color:#09885A'>0</span><span style=3D'color:black'>;</span><o:p></o:=
p></p></div><div><p class=3DMsoNormal><span style=3D'color:black'>}</span><=
o:p></o:p></p></div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div></div><=
p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNormal><o:p>&nbsp;</=
o:p></p><p class=3DMsoNormal>Sent from <a href=3D"https://go.microsoft.com/=
fwlink/?LinkId=3D550986">Mail</a> for Windows 10</p><p class=3DMsoNormal><o=
:p>&nbsp;</o:p></p><div style=3D'mso-element:para-border-div;border:none;bo=
rder-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=3DMsoNorma=
l style=3D'border:none;padding:0in'><b>From: </b><a href=3D"mailto:blitzrak=
ete@gmail.com">Nicolas Lesser</a><br><b>Sent: </b>Sunday, April 15, 2018 8:=
50 AM<br><b>To: </b><a href=3D"mailto:std-proposals@isocpp.org">std-proposa=
ls@isocpp.org</a><br><b>Subject: </b>Re: [std-proposals] Lambda annotations=
</p></div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><p class=3DMsoNorm=
al>Well, you could use either a new attribute or an implementation-defined =
attribute to give the lambda a name for debugging/error reporting purposes.=
</p></div><div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><p class=3DMs=
oNormal>On Sun, Apr 15, 2018 at 5:28 PM, Ritwik Das &lt;<a href=3D"mailto:r=
itwik.sami1990@gmail.com" target=3D"_blank">ritwik.sami1990@gmail.com</a>&g=
t; wrote:</p><blockquote style=3D'border:none;border-left:solid #CCCCCC 1.0=
pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div>=
<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto'>But I am still confused how attributes can solve the problems mentio=
ned below?</p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-mar=
gin-bottom-alt:auto'>&nbsp;</p><p class=3DMsoNormal style=3D'mso-margin-top=
-alt:auto;mso-margin-bottom-alt:auto'>Sent from <a href=3D"https://go.micro=
soft.com/fwlink/?LinkId=3D550986" target=3D"_blank">Mail</a> for Windows 10=
</p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom=
-alt:auto'>&nbsp;</p><div style=3D'border:none;border-top:solid #E1E1E1 1.0=
pt;padding:3.0pt 0in 0in 0in'><p class=3DMsoNormal style=3D'mso-margin-top-=
alt:auto;mso-margin-bottom-alt:auto'><b>From: </b><a href=3D"mailto:blitzra=
kete@gmail.com" target=3D"_blank">Nicolas Lesser</a><br><b>Sent: </b>Sunday=
, April 15, 2018 1:03 AM<br><b>To: </b><a href=3D"mailto:std-proposals@isoc=
pp.org" target=3D"_blank">std-proposals@isocpp.org</a><br><b>Subject: </b>R=
e: [std-proposals] Lambda annotations</p></div><div><div><p class=3DMsoNorm=
al style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;</p><=
div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom=
-alt:auto'>There was a proposal or idea once to name lambdas to be able to =
name the lambda inside the lambda, and the syntax exactly matches what you =
propose.</p><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-=
margin-bottom-alt:auto'>&nbsp;</p></div><div><p class=3DMsoNormal style=3D'=
mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Currently you can use a=
n attribute :).</p></div></div><div><p class=3DMsoNormal style=3D'mso-margi=
n-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;</p><div><p class=3DMsoNor=
mal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>On Sun, Ap=
r 15, 2018 at 9:28 AM, Ritwik Das &lt;<a href=3D"mailto:ritwik.sami1990@gma=
il.com" target=3D"_blank">ritwik.sami1990@gmail.com</a>&gt; wrote:</p><bloc=
kquote style=3D'border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in=
 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-botto=
m:5.0pt'><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-mar=
gin-bottom-alt:auto'><span style=3D'font-size:13.5pt'>Problem:</span></p><d=
iv><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-=
alt:auto'>The fact that lambda functions are by design unnamed means that t=
he compiler has to assign names which show up in the call stack while debug=
ging and also in dumps etc. This makes things especially difficult for auto=
mated tools which categorize dumps based on the call stack because the comp=
iler assigned lambda names tend to change over time. Some specific problems=
 which occur because of the compiler assigning random names to lambda funct=
ions are cited below:</p></div><div><p class=3DMsoNormal style=3D'mso-margi=
n-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;</p></div><div><p class=3D=
MsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b>E=
xample 1:</b></p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-al=
t:auto;mso-margin-bottom-alt:auto'><u>Sample code:</u></p></div><div><div><=
p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:=
auto'>template&lt;typename T&gt;</p></div><div><p class=3DMsoNormal style=
=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>int func(T&amp;&amp=
; lambda)</p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:au=
to;mso-margin-bottom-alt:auto'>{</p></div><div><p class=3DMsoNormal style=
=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>lambda();</p></div>=
<div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-botto=
m-alt:auto'>}</p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-al=
t:auto;mso-margin-bottom-alt:auto'>&nbsp;</p></div><div><p class=3DMsoNorma=
l style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>int main()</=
p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-marg=
in-bottom-alt:auto'>{</p></div><div><p class=3DMsoNormal style=3D'mso-margi=
n-top-alt:auto;mso-margin-bottom-alt:auto'>func([]() {std::cout &lt;&lt; &q=
uot;Hello!&quot;; });</p></div><div><p class=3DMsoNormal style=3D'mso-margi=
n-top-alt:auto;mso-margin-bottom-alt:auto'>return 0;</p></div><div><p class=
=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>}=
</p></div></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;=
mso-margin-bottom-alt:auto'>&nbsp;</p></div><div><p class=3DMsoNormal style=
=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><u>Compiler Error:<=
/u></p></div><div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:aut=
o;mso-margin-bottom-alt:auto'>1&gt;lambda.cpp</p></div><div><p class=3DMsoN=
ormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>1&gt;\la=
mbda.cpp(11): error C4716: 'func&lt;&lt;<b>lambda_4653923a58ae9d647caab6ef4=
f61a443</b>&gt; &gt;': must return a value</p></div></div><div><p class=3DM=
soNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp=
;</p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-m=
argin-bottom-alt:auto'>Errors like this are hard to track because the error=
 message does not really identify the source of the problem.</p></div><div>=
<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto'>&nbsp;</p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-al=
t:auto;mso-margin-bottom-alt:auto'><b>Example 2:</b></p></div><div><div><p =
class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:au=
to'>&gt; ClassA::frame6 C++</p></div><div><p class=3DMsoNormal style=3D'mso=
-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp; ClassA::frame4::<b>=
__l62::&lt;lambda&gt;</b> C++</p></div><div><p class=3DMsoNormal style=3D'm=
so-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp; ClassB::frame3&lt=
;lambda&gt;(void) &gt; C++</p></div><div><p class=3DMsoNormal style=3D'mso-=
margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp; ClassA::frame2 C++</=
p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-marg=
in-bottom-alt:auto'>&nbsp; ClassA::frame1 C++</p></div></div><div><p class=
=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&=
nbsp;</p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;m=
so-margin-bottom-alt:auto'>In the above call stack, the lambda function is =
referred to as &quot;__l62&quot; which neither is very useful nor does this=
 stay invariant over time as more lambdas are added to the codebase (it is =
not even clear how this name is chosen by the compiler).</p></div><div><p c=
lass=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:aut=
o'>&nbsp;</p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:au=
to;mso-margin-bottom-alt:auto'><span style=3D'font-size:13.5pt'>Proposal:</=
span></p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;m=
so-margin-bottom-alt:auto'>If there is a way for optionally annotating lamb=
da functions with the declaration, the compiler can use this to produce lam=
bda names more consistently. e.g. The strawman syntax can be something like=
: &quot;[=3D] <b>mylambda1</b>() {...}&quot;. This might seem counter-intui=
tive since lambdas are defined to be <i>anonymous</i> functions, adding an =
optional annotation to the lambda does not really take away the benefits of=
 using lambdas over functions but rather makes it more powerful.</p></div><=
div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom=
-alt:auto'>&nbsp;</p></div><div><p class=3DMsoNormal style=3D'mso-margin-to=
p-alt:auto;mso-margin-bottom-alt:auto'>P.S.:</p></div><div><p class=3DMsoNo=
rmal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Apologies=
 if I missed proposals which addresses the above problem.</p></div></div><p=
 class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:a=
uto'><span class=3Dm4195605197699100460hoenzb><span style=3D'color:#888888'=
>-- </span></span><span style=3D'color:#888888'><br><span class=3Dm41956051=
97699100460hoenzb>You received this message because you are subscribed to t=
he Google Groups &quot;ISO C++ Standard - Future Proposals&quot; group.</sp=
an><br><span class=3Dm4195605197699100460hoenzb>To unsubscribe from this gr=
oup and stop receiving emails from it, send an email to <a href=3D"mailto:s=
td-proposals+unsubscribe@isocpp.org" target=3D"_blank">std-proposals+unsubs=
cribe@isocpp.org</a>.</span><br><span class=3Dm4195605197699100460hoenzb>To=
 post to this group, send email to <a href=3D"mailto:std-proposals@isocpp.o=
rg" target=3D"_blank">std-proposals@isocpp.org</a>.</span><br><span class=
=3Dm4195605197699100460hoenzb>To view this discussion on the web visit <a h=
ref=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5225897=
d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=3Demail&amp;utm_sourc=
e=3Dfooter" target=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgi=
d/std-proposals/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org</a>.</spa=
n></span></p></blockquote></div><p class=3DMsoNormal style=3D'mso-margin-to=
p-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;</p></div></div></div><div><di=
v><p class=3DMsoNormal>-- <br>You received this message because you are sub=
scribed to the Google Groups &quot;ISO C++ Standard - Future Proposals&quot=
; group.<br>To unsubscribe from this group and stop receiving emails from i=
t, send an email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org"=
 target=3D"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>To post to =
this group, send email to <a href=3D"mailto:std-proposals@isocpp.org" targe=
t=3D"_blank">std-proposals@isocpp.org</a>.</p></div></div><p class=3DMsoNor=
mal>To view this discussion on the web visit <a href=3D"https://groups.goog=
le.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq2sdDK05--85eo%3DeNRceVjqRA=
1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=
=3Dfooter" target=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid=
/std-proposals/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40ma=
il.gmail.com</a>.</p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;=
mso-margin-bottom-alt:auto'>&nbsp;</p></div></div><p class=3DMsoNormal>-- <=
br>You received this message because you are subscribed to the Google Group=
s &quot;ISO C++ Standard - Future Proposals&quot; group.<br>To unsubscribe =
from this group and stop receiving emails from it, send an email to <a href=
=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank">std-prop=
osals+unsubscribe@isocpp.org</a>.<br>To post to this group, send email to <=
a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-proposals@=
isocpp.org</a>.<br>To view this discussion on the web visit <a href=3D"http=
s://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad36f81.c614620a.=
ddf08.2250%40mx.google.com?utm_medium=3Demail&amp;utm_source=3Dfooter" targ=
et=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/=
5ad36f81.c614620a.ddf08.2250%40mx.google.com</a>.</p></blockquote></div><p =
class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><p class=3DMsoNormal>-- <br>Yo=
u received this message because you are subscribed to the Google Groups &qu=
ot;ISO C++ Standard - Future Proposals&quot; group.<br>To unsubscribe from =
this group and stop receiving emails from it, send an email to <a href=3D"m=
ailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocp=
p.org</a>.<br>To post to this group, send email to <a href=3D"mailto:std-pr=
oposals@isocpp.org">std-proposals@isocpp.org</a>.<br>To view this discussio=
n on the web visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgi=
d/std-proposals/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40m=
ail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter">https://groups.go=
ogle.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ=
%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com</a>.</p><p class=3DMsoNormal><o:p=
>&nbsp;</o:p></p></div></body></html>

<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/5ad37a5f.d164650a.b857a.760b%40mx.goo=
gle.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/a=
/isocpp.org/d/msgid/std-proposals/5ad37a5f.d164650a.b857a.760b%40mx.google.=
com</a>.<br />

--_A022973E-5E6C-4E96-94F4-E78AA3573916_--


.


Author: Nicolas Lesser <blitzrakete@gmail.com>
Date: Sun, 15 Apr 2018 18:19:49 +0200
Raw View
--0000000000008000d40569e57951
Content-Type: text/plain; charset="UTF-8"

I don't think that those annotations should change the actual symbol
generated, because that would mean that you could break the ABI by simply
changing the name of the lambda, and conflicts can happen quite quickly. I
would rather see those names used as informal lambda name for debugging and
error reporting messages.

Also, this was just an idea. Currently there is no way to do that, so it's
just normal that in your case they don't do anything.

On Sun, Apr 15, 2018 at 6:14 PM, Ritwik Das <ritwik.sami1990@gmail.com>
wrote:

> Standard attributes/implementation specific attributes do not help much in
> this case but new attributes do not affect the compiler generated names I
> would want symbols to be generated based on the given names. I tried
> something like this but the names are random regardless. What am I missing?
>
>
>
> #include <iostream>
>
>
>
> template<typename T>
>
> void func(T&& lambda)
>
> {
>
>     lambda();
>
> }
>
>
>
> int main()
>
> {
>
>     func([]()[[cats::meow]] {std::cout << "Hello!"; });
>
>     func([]() {std::cout << "world!"; });
>
>     return 0;
>
> }
>
>
>
>
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> *From: *Nicolas Lesser <blitzrakete@gmail.com>
> *Sent: *Sunday, April 15, 2018 8:50 AM
>
> *To: *std-proposals@isocpp.org
> *Subject: *Re: [std-proposals] Lambda annotations
>
>
>
> Well, you could use either a new attribute or an implementation-defined
> attribute to give the lambda a name for debugging/error reporting purposes.
>
>
>
> On Sun, Apr 15, 2018 at 5:28 PM, Ritwik Das <ritwik.sami1990@gmail.com>
> wrote:
>
> But I am still confused how attributes can solve the problems mentioned
> below?
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> *From: *Nicolas Lesser <blitzrakete@gmail.com>
> *Sent: *Sunday, April 15, 2018 1:03 AM
> *To: *std-proposals@isocpp.org
> *Subject: *Re: [std-proposals] Lambda annotations
>
>
>
> There was a proposal or idea once to name lambdas to be able to name the
> lambda inside the lambda, and the syntax exactly matches what you propose.
>
>
>
> Currently you can use an attribute :).
>
>
>
> On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das <ritwik.sami1990@gmail.com>
> wrote:
>
> Problem:
>
> The fact that lambda functions are by design unnamed means that the
> compiler has to assign names which show up in the call stack while
> debugging and also in dumps etc. This makes things especially difficult for
> automated tools which categorize dumps based on the call stack because the
> compiler assigned lambda names tend to change over time. Some specific
> problems which occur because of the compiler assigning random names to
> lambda functions are cited below:
>
>
>
> *Example 1:*
>
> *Sample code:*
>
> template<typename T>
>
> int func(T&& lambda)
>
> {
>
> lambda();
>
> }
>
>
>
> int main()
>
> {
>
> func([]() {std::cout << "Hello!"; });
>
> return 0;
>
> }
>
>
>
> *Compiler Error:*
>
> 1>lambda.cpp
>
> 1>\lambda.cpp(11): error C4716: 'func<<
> *lambda_4653923a58ae9d647caab6ef4f61a443*> >': must return a value
>
>
>
> Errors like this are hard to track because the error message does not
> really identify the source of the problem.
>
>
>
> *Example 2:*
>
> > ClassA::frame6 C++
>
>   ClassA::frame4::*__l62::<lambda>* C++
>
>   ClassB::frame3<lambda>(void) > C++
>
>   ClassA::frame2 C++
>
>   ClassA::frame1 C++
>
>
>
> In the above call stack, the lambda function is referred to as "__l62"
> which neither is very useful nor does this stay invariant over time as more
> lambdas are added to the codebase (it is not even clear how this name is
> chosen by the compiler).
>
>
>
> Proposal:
>
> If there is a way for optionally annotating lambda functions with the
> declaration, the compiler can use this to produce lambda names more
> consistently. e.g. The strawman syntax can be something like: "[=]
> *mylambda1*() {...}". This might seem counter-intuitive since lambdas are
> defined to be *anonymous* functions, adding an optional annotation to the
> lambda does not really take away the benefits of using lambdas over
> functions but rather makes it more powerful.
>
>
>
> P.S.:
>
> Apologies if I missed proposals which addresses the above problem.
>
> --
> 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/5225897d-fa81-4137-
> 928d-f97fcb4f2efe%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
>
>
> --
> 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/CALmDwq2sdDK05--
> 85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>
>
> --
> 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/5ad36f81.c614620a.
> ddf08.2250%40mx.google.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad36f81.c614620a.ddf08.2250%40mx.google.com?utm_medium=email&utm_source=footer>
> .
>
>
>
> --
> 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/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZ
> Z%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>
>
> --
> 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/5ad37a5f.d164650a.
> b857a.760b%40mx.google.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad37a5f.d164650a.b857a.760b%40mx.google.com?utm_medium=email&utm_source=footer>
> .
>

--
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/CALmDwq0tZUjRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68%3DNQ%40mail.gmail.com.

--0000000000008000d40569e57951
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I don&#39;t think that those annotations should change the=
 actual symbol generated, because that would mean that you could break the =
ABI by simply changing the name of the lambda, and conflicts can happen qui=
te quickly. I would rather see those names used as informal lambda name for=
 debugging and error reporting messages.<div><br></div><div>Also, this was =
just an idea. Currently there is no way to do that, so it&#39;s just normal=
 that in your case they don&#39;t do anything.</div></div><div class=3D"gma=
il_extra"><br><div class=3D"gmail_quote">On Sun, Apr 15, 2018 at 6:14 PM, R=
itwik Das <span dir=3D"ltr">&lt;<a href=3D"mailto:ritwik.sami1990@gmail.com=
" target=3D"_blank">ritwik.sami1990@gmail.com</a>&gt;</span> wrote:<br><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div lang=3D"EN-US" link=3D"blue" vlink=3D"#954F=
72"><div class=3D"m_6031191767155126304WordSection1"><p class=3D"MsoNormal"=
>Standard attributes/implementation specific attributes do not help much in=
 this case but new attributes do not affect the compiler generated names I =
would want symbols to be generated based on the given names. I tried someth=
ing like this but the names are random regardless. What am I missing?</p><p=
 class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><div><div><div><p class=3D"Mso=
Normal"><span style=3D"color:blue">#include</span><span style=3D"color:blac=
k"> &lt;iostream&gt;</span><u></u><u></u></p></div><p class=3D"MsoNormal"><=
u></u>=C2=A0<u></u></p><div><p class=3D"MsoNormal"><span style=3D"color:blu=
e">template</span><span style=3D"color:black">&lt;</span><span style=3D"col=
or:blue">typename</span><span style=3D"color:black"> T&gt;</span><u></u><u>=
</u></p></div><div><p class=3D"MsoNormal"><span style=3D"color:blue">void</=
span><span style=3D"color:black"> func(T&amp;&amp; lambda)</span><u></u><u>=
</u></p></div><div><p class=3D"MsoNormal"><span style=3D"color:black">{</sp=
an><u></u><u></u></p></div><div><p class=3D"MsoNormal"><span style=3D"color=
:black">=C2=A0=C2=A0=C2=A0=C2=A0lambda();</span><u></u><u></u></p></div><di=
v><p class=3D"MsoNormal"><span style=3D"color:black">}</span><u></u><u></u>=
</p></div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><div><p class=3D"M=
soNormal"><span style=3D"color:blue">int</span><span style=3D"color:black">=
 main()</span><u></u><u></u></p></div><div><p class=3D"MsoNormal"><span sty=
le=3D"color:black">{</span><u></u><u></u></p></div><div><p class=3D"MsoNorm=
al"><span style=3D"color:black">=C2=A0=C2=A0=C2=A0=C2=A0func([]()</span><sp=
an style=3D"color:gray">[[cats::meow]]</span><span style=3D"color:black"> {=
std::cout &lt;&lt; </span><span style=3D"color:#a31515">&quot;Hello!&quot;<=
/span><span style=3D"color:black">; });</span><u></u><u></u></p></div><div>=
<p class=3D"MsoNormal"><span style=3D"color:black">=C2=A0=C2=A0=C2=A0=C2=A0=
func([]() {std::cout &lt;&lt; </span><span style=3D"color:#a31515">&quot;wo=
rld!&quot;</span><span style=3D"color:black">; });</span><u></u><u></u></p>=
</div><div><p class=3D"MsoNormal"><span style=3D"color:black">=C2=A0=C2=A0=
=C2=A0=C2=A0</span><span style=3D"color:blue">return</span><span style=3D"c=
olor:black"> </span><span style=3D"color:#09885a">0</span><span style=3D"co=
lor:black">;</span><u></u><u></u></p></div><div><p class=3D"MsoNormal"><spa=
n style=3D"color:black">}</span><u></u><u></u></p></div><p class=3D"MsoNorm=
al"><u></u>=C2=A0<u></u></p></div></div><span class=3D""><p class=3D"MsoNor=
mal"><u></u>=C2=A0<u></u></p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p=
><p class=3D"MsoNormal">Sent from <a href=3D"https://go.microsoft.com/fwlin=
k/?LinkId=3D550986" target=3D"_blank">Mail</a> for Windows 10</p><p class=
=3D"MsoNormal"><u></u>=C2=A0<u></u></p></span><div style=3D"border:none;bor=
der-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class=3D"MsoNorma=
l" style=3D"border:none;padding:0in"><b>From: </b><a href=3D"mailto:blitzra=
kete@gmail.com" target=3D"_blank">Nicolas Lesser</a><br><b>Sent: </b>Sunday=
, April 15, 2018 8:50 AM</p><div><div class=3D"h5"><br><b>To: </b><a href=
=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp=
..org</a><br><b>Subject: </b>Re: [std-proposals] Lambda annotations</div></d=
iv><p></p></div><div><div class=3D"h5"><p class=3D"MsoNormal"><u></u>=C2=A0=
<u></u></p><div><p class=3D"MsoNormal">Well, you could use either a new att=
ribute or an implementation-defined attribute to give the lambda a name for=
 debugging/error reporting purposes.</p></div><div><p class=3D"MsoNormal"><=
u></u>=C2=A0<u></u></p><div><p class=3D"MsoNormal">On Sun, Apr 15, 2018 at =
5:28 PM, Ritwik Das &lt;<a href=3D"mailto:ritwik.sami1990@gmail.com" target=
=3D"_blank">ritwik.sami1990@gmail.com</a>&gt; wrote:</p><blockquote style=
=3D"border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;m=
argin-left:4.8pt;margin-right:0in"><div><div><p class=3D"MsoNormal">But I a=
m still confused how attributes can solve the problems mentioned below?</p>=
<p class=3D"MsoNormal">=C2=A0</p><p class=3D"MsoNormal">Sent from <a href=
=3D"https://go.microsoft.com/fwlink/?LinkId=3D550986" target=3D"_blank">Mai=
l</a> for Windows 10</p><p class=3D"MsoNormal">=C2=A0</p><div style=3D"bord=
er:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class=
=3D"MsoNormal"><b>From: </b><a href=3D"mailto:blitzrakete@gmail.com" target=
=3D"_blank">Nicolas Lesser</a><br><b>Sent: </b>Sunday, April 15, 2018 1:03 =
AM<br><b>To: </b><a href=3D"mailto:std-proposals@isocpp.org" target=3D"_bla=
nk">std-proposals@isocpp.org</a><br><b>Subject: </b>Re: [std-proposals] Lam=
bda annotations</p></div><div><div><p class=3D"MsoNormal">=C2=A0</p><div><p=
 class=3D"MsoNormal">There was a proposal or idea once to name lambdas to b=
e able to name the lambda inside the lambda, and the syntax exactly matches=
 what you propose.</p><div><p class=3D"MsoNormal">=C2=A0</p></div><div><p c=
lass=3D"MsoNormal">Currently you can use an attribute :).</p></div></div><d=
iv><p class=3D"MsoNormal">=C2=A0</p><div><p class=3D"MsoNormal">On Sun, Apr=
 15, 2018 at 9:28 AM, Ritwik Das &lt;<a href=3D"mailto:ritwik.sami1990@gmai=
l.com" target=3D"_blank">ritwik.sami1990@gmail.com</a>&gt; wrote:</p><block=
quote style=3D"border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in =
0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom=
:5.0pt"><div><p class=3D"MsoNormal"><span style=3D"font-size:13.5pt">Proble=
m:</span></p><div><p class=3D"MsoNormal">The fact that lambda functions are=
 by design unnamed means that the compiler has to assign names which show u=
p in the call stack while debugging and also in dumps etc. This makes thing=
s especially difficult for automated tools which categorize dumps based on =
the call stack because the compiler assigned lambda names tend to change ov=
er time. Some specific problems which occur because of the compiler assigni=
ng random names to lambda functions are cited below:</p></div><div><p class=
=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNormal"><b>Example 1:</b=
></p></div><div><p class=3D"MsoNormal"><u>Sample code:</u></p></div><div><d=
iv><p class=3D"MsoNormal">template&lt;typename T&gt;</p></div><div><p class=
=3D"MsoNormal">int func(T&amp;&amp; lambda)</p></div><div><p class=3D"MsoNo=
rmal">{</p></div><div><p class=3D"MsoNormal">lambda();</p></div><div><p cla=
ss=3D"MsoNormal">}</p></div><div><p class=3D"MsoNormal">=C2=A0</p></div><di=
v><p class=3D"MsoNormal">int main()</p></div><div><p class=3D"MsoNormal">{<=
/p></div><div><p class=3D"MsoNormal">func([]() {std::cout &lt;&lt; &quot;He=
llo!&quot;; });</p></div><div><p class=3D"MsoNormal">return 0;</p></div><di=
v><p class=3D"MsoNormal">}</p></div></div><div><p class=3D"MsoNormal">=C2=
=A0</p></div><div><p class=3D"MsoNormal"><u>Compiler Error:</u></p></div><d=
iv><div><p class=3D"MsoNormal">1&gt;lambda.cpp</p></div><div><p class=3D"Ms=
oNormal">1&gt;\lambda.cpp(11): error C4716: &#39;func&lt;&lt;<b>lambda_<wbr=
>4653923a58ae9d647caab6ef4f61a4<wbr>43</b>&gt; &gt;&#39;: must return a val=
ue</p></div></div><div><p class=3D"MsoNormal">=C2=A0</p></div><div><p class=
=3D"MsoNormal">Errors like this are hard to track because the error message=
 does not really identify the source of the problem.</p></div><div><p class=
=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNormal"><b>Example 2:</b=
></p></div><div><div><p class=3D"MsoNormal">&gt; ClassA::frame6 C++</p></di=
v><div><p class=3D"MsoNormal">=C2=A0 ClassA::frame4::<b>__l62::&lt;<wbr>lam=
bda&gt;</b> C++</p></div><div><p class=3D"MsoNormal">=C2=A0 ClassB::frame3&=
lt;lambda&gt;(void) &gt; C++</p></div><div><p class=3D"MsoNormal">=C2=A0 Cl=
assA::frame2 C++</p></div><div><p class=3D"MsoNormal">=C2=A0 ClassA::frame1=
 C++</p></div></div><div><p class=3D"MsoNormal">=C2=A0</p></div><div><p cla=
ss=3D"MsoNormal">In the above call stack, the lambda function is referred t=
o as &quot;__l62&quot; which neither is very useful nor does this stay inva=
riant over time as more lambdas are added to the codebase (it is not even c=
lear how this name is chosen by the compiler).</p></div><div><p class=3D"Ms=
oNormal">=C2=A0</p></div><div><p class=3D"MsoNormal"><span style=3D"font-si=
ze:13.5pt">Proposal:</span></p></div><div><p class=3D"MsoNormal">If there i=
s a way for optionally annotating lambda functions with the declaration, th=
e compiler can use this to produce lambda names more consistently. e.g. The=
 strawman syntax can be something like: &quot;[=3D] <b>mylambda1</b>() {...=
}&quot;. This might seem counter-intuitive since lambdas are defined to be =
<i>anonymous</i> functions, adding an optional annotation to the lambda doe=
s not really take away the benefits of using lambdas over functions but rat=
her makes it more powerful.</p></div><div><p class=3D"MsoNormal">=C2=A0</p>=
</div><div><p class=3D"MsoNormal">P.S.:</p></div><div><p class=3D"MsoNormal=
">Apologies if I missed proposals which addresses the above problem.</p></d=
iv></div><p class=3D"MsoNormal"><span class=3D"m_6031191767155126304m419560=
5197699100460hoenzb"><span style=3D"color:#888888">-- </span></span><span s=
tyle=3D"color:#888888"><br><span class=3D"m_6031191767155126304m41956051976=
99100460hoenzb">You received this message because you are subscribed to the=
 Google Groups &quot;ISO C++ Standard - Future Proposals&quot; group.</span=
><br><span class=3D"m_6031191767155126304m4195605197699100460hoenzb">To uns=
ubscribe from this group and stop receiving emails from it, send an email t=
o <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank"=
>std-proposals+unsubscribe@<wbr>isocpp.org</a>.</span><br><span class=3D"m_=
6031191767155126304m4195605197699100460hoenzb">To post to this group, send =
email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-=
proposals@isocpp.org</a>.</span><br><span class=3D"m_6031191767155126304m41=
95605197699100460hoenzb">To view this discussion on the web visit <a href=
=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5225897d-f=
a81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=3Demail&amp;utm_source=
=3Dfooter" target=3D"_blank">https://groups.google.com/a/<wbr>isocpp.org/d/=
msgid/std-<wbr>proposals/5225897d-fa81-4137-<wbr>928d-f97fcb4f2efe%40isocpp=
..org</a><wbr>.</span></span></p></blockquote></div><p class=3D"MsoNormal">=
=C2=A0</p></div></div></div><div><div><p class=3D"MsoNormal">-- <br>You rec=
eived this message because you are subscribed to the Google Groups &quot;IS=
O C++ Standard - Future Proposals&quot; group.<br>To unsubscribe from this =
group and stop receiving emails from it, send an email to <a href=3D"mailto=
:std-proposals+unsubscribe@isocpp.org" target=3D"_blank">std-proposals+unsu=
bscribe@<wbr>isocpp.org</a>.<br>To post to this group, send email to <a hre=
f=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-proposals@isocp=
p.org</a>.</p></div></div><p class=3D"MsoNormal">To view this discussion on=
 the web visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.=
gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">htt=
ps://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/CALmDwq=
2sdDK05--<wbr>85eo%3DeNRceVjqRA1-W7DLVof0h%<wbr>2BJ0jjVgMw%40mail.gmail.com=
</a>.</p><p class=3D"MsoNormal">=C2=A0</p></div></div><p class=3D"MsoNormal=
">-- <br>You received this message because you are subscribed to the Google=
 Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br>To unsubs=
cribe from this group and stop receiving emails from it, send an email to <=
a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank">st=
d-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>To post to this group, send=
 email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std=
-proposals@isocpp.org</a>.<br>To view this discussion on the web visit <a h=
ref=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad36f8=
1.c614620a.ddf08.2250%40mx.google.com?utm_medium=3Demail&amp;utm_source=3Df=
ooter" target=3D"_blank">https://groups.google.com/a/<wbr>isocpp.org/d/msgi=
d/std-<wbr>proposals/5ad36f81.c614620a.<wbr>ddf08.2250%40mx.google.com</a>.=
</p></blockquote></div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div=
></div></div><p class=3D"MsoNormal"></p><div><div class=3D"h5">-- <br>You r=
eceived this message because you are subscribed to the Google Groups &quot;=
ISO C++ Standard - Future Proposals&quot; group.<br>To unsubscribe from thi=
s group and stop receiving emails from it, send an email to <a href=3D"mail=
to:std-proposals+unsubscribe@isocpp.org" target=3D"_blank">std-proposals+un=
subscribe@<wbr>isocpp.org</a>.<br>To post to this group, send email to <a h=
ref=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-proposals@iso=
cpp.org</a>.<br></div></div>To view this discussion on the web visit <a hre=
f=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq1o=
GuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com?utm_medium=
=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">https://groups.google.c=
om/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/<wbr>CALmDwq1oGuP3Bj3AfHVnJ=
K2eozRWZ<wbr>Z%3DOjf6AQaQPB%2ByLiz1oJg%<wbr>40mail.gmail.com</a>.<p></p><p =
class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div></div><span class=3D"">

<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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/5ad37a5f.d164650a.b857a.760b%40mx.goo=
gle.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">https=
://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/5ad37a5f.=
d164650a.<wbr>b857a.760b%40mx.google.com</a>.<br>
</blockquote></div><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/CALmDwq0tZUjRMpD7i_pwKS_G2%2BgvwCH5T%=
2BaJEypujVuEx68%3DNQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq0tZU=
jRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68%3DNQ%40mail.gmail.com</a>.<br />

--0000000000008000d40569e57951--

.


Author: Ritwik Das <ritwik.sami1990@gmail.com>
Date: Sun, 15 Apr 2018 10:13:25 -0700
Raw View
--_E168E463-16A1-4E99-AFEE-FE8633C4C865_
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

Isn=E2=80=99t that the same behavior when someone changes regular function =
names, symbols for which depend on the given names based on some predefined=
 mangling rules. I don=E2=80=99t want this to be any different for lambdas =
and that is what this proposal is about=E2=80=A6

Sent from Mail for Windows 10

From: Nicolas Lesser
Sent: Sunday, April 15, 2018 9:19 AM
To: std-proposals@isocpp.org
Subject: Re: [std-proposals] Lambda annotations

I don't think that those annotations should change the actual symbol genera=
ted, because that would mean that you could break the ABI by simply changin=
g the name of the lambda, and conflicts can happen quite quickly. I would r=
ather see those names used as informal lambda name for debugging and error =
reporting messages.

Also, this was just an idea. Currently there is no way to do that, so it's =
just normal that in your case they don't do anything.

On Sun, Apr 15, 2018 at 6:14 PM, Ritwik Das <ritwik.sami1990@gmail.com> wro=
te:
Standard attributes/implementation specific attributes do not help much in =
this case but new attributes do not affect the compiler generated names I w=
ould want symbols to be generated based on the given names. I tried somethi=
ng like this but the names are random regardless. What am I missing?
=C2=A0
#include <iostream>
=C2=A0
template<typename T>
void func(T&& lambda)
{
=C2=A0=C2=A0=C2=A0=C2=A0lambda();
}
=C2=A0
int main()
{
=C2=A0=C2=A0=C2=A0=C2=A0func([]()[[cats::meow]] {std::cout << "Hello!"; });
=C2=A0=C2=A0=C2=A0=C2=A0func([]() {std::cout << "world!"; });
=C2=A0=C2=A0=C2=A0=C2=A0return 0;
}
=C2=A0
=C2=A0
=C2=A0
Sent from Mail for Windows 10
=C2=A0
From: Nicolas Lesser
Sent: Sunday, April 15, 2018 8:50 AM

To: std-proposals@isocpp.org
Subject: Re: [std-proposals] Lambda annotations
=C2=A0
Well, you could use either a new attribute or an implementation-defined att=
ribute to give the lambda a name for debugging/error reporting purposes.
=C2=A0
On Sun, Apr 15, 2018 at 5:28 PM, Ritwik Das <ritwik.sami1990@gmail.com> wro=
te:
But I am still confused how attributes can solve the problems mentioned bel=
ow?
=C2=A0
Sent from Mail for Windows 10
=C2=A0
From: Nicolas Lesser
Sent: Sunday, April 15, 2018 1:03 AM
To: std-proposals@isocpp.org
Subject: Re: [std-proposals] Lambda annotations
=C2=A0
There was a proposal or idea once to name lambdas to be able to name the la=
mbda inside the lambda, and the syntax exactly matches what you propose.
=C2=A0
Currently you can use an attribute :).
=C2=A0
On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das <ritwik.sami1990@gmail.com> wro=
te:
Problem:
The fact that lambda functions are by design unnamed means that the compile=
r has to assign names which show up in the call stack while debugging and a=
lso in dumps etc. This makes things especially difficult for automated tool=
s which categorize dumps based on the call stack because the compiler assig=
ned lambda names tend to change over time. Some specific problems which occ=
ur because of the compiler assigning random names to lambda functions are c=
ited below:
=C2=A0
Example 1:
Sample code:
template<typename T>
int func(T&& lambda)
{
lambda();
}
=C2=A0
int main()
{
func([]() {std::cout << "Hello!"; });
return 0;
}
=C2=A0
Compiler Error:
1>lambda.cpp
1>\lambda.cpp(11): error C4716: 'func<<lambda_4653923a58ae9d647caab6ef4f61a=
443> >': must return a value
=C2=A0
Errors like this are hard to track because the error message does not reall=
y identify the source of the problem.
=C2=A0
Example 2:
> ClassA::frame6 C++
=C2=A0 ClassA::frame4::__l62::<lambda> C++
=C2=A0 ClassB::frame3<lambda>(void) > C++
=C2=A0 ClassA::frame2 C++
=C2=A0 ClassA::frame1 C++
=C2=A0
In the above call stack, the lambda function is referred to as "__l62" whic=
h neither is very useful nor does this stay invariant over time as more lam=
bdas are added to the codebase (it is not even clear how this name is chose=
n by the compiler).
=C2=A0
Proposal:
If there is a way for optionally annotating lambda functions with the decla=
ration, the compiler can use this to produce lambda names more consistently=
.. e.g. The strawman syntax can be something like: "[=3D] mylambda1() {...}"=
.. This might seem counter-intuitive since lambdas are defined to be anonymo=
us functions, adding an optional annotation to the lambda does not really t=
ake away the benefits of using lambdas over functions but rather makes it m=
ore powerful.
=C2=A0
P.S.:
Apologies if I missed proposals which addresses the above problem.
--=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/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.or=
g.
=C2=A0
--=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/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ=
0jjVgMw%40mail.gmail.com.
=C2=A0
--=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/5ad36f81.c614620a.ddf08.2250%40mx.google.com.
=C2=A0
--=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/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2By=
Liz1oJg%40mail.gmail.com.
=C2=A0
--=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/5ad37a5f.d164650a.b857a.760b%40mx.google.com.

--=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/CALmDwq0tZUjRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVu=
Ex68%3DNQ%40mail.gmail.com.

--=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/5ad38837.435a620a.8b39e.a4c7%40mx.google.com.

--_E168E463-16A1-4E99-AFEE-FE8633C4C865_
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="UTF-8"

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:sc=
hemas-microsoft-com:office:word" xmlns:m=3D"http://schemas.microsoft.com/of=
fice/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta ht=
tp-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8"><meta name=
=3DGenerator content=3D"Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
 {font-family:"Cambria Math";
 panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
 {font-family:Calibri;
 panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
 {margin:0in;
 margin-bottom:.0001pt;
 font-size:11.0pt;
 font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
 {mso-style-priority:99;
 color:blue;
 text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
 {mso-style-priority:99;
 color:#954F72;
 text-decoration:underline;}
span.m6031191767155126304m4195605197699100460hoenzb
 {mso-style-name:m_6031191767155126304m4195605197699100460hoenzb;}
..MsoChpDefault
 {mso-style-type:export-only;}
@page WordSection1
 {size:8.5in 11.0in;
 margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
 {page:WordSection1;}
--></style></head><body lang=3DEN-US link=3Dblue vlink=3D"#954F72"><div cla=
ss=3DWordSection1><p class=3DMsoNormal>Isn=E2=80=99t that the same behavior=
 when someone changes regular function names, symbols for which depend on t=
he given names based on some predefined mangling rules. I don=E2=80=99t wan=
t this to be any different for lambdas and that is what this proposal is ab=
out=E2=80=A6</p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><p class=3DMsoNor=
mal>Sent from <a href=3D"https://go.microsoft.com/fwlink/?LinkId=3D550986">=
Mail</a> for Windows 10</p><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><div s=
tyle=3D'mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.=
0pt;padding:3.0pt 0in 0in 0in'><p class=3DMsoNormal style=3D'border:none;pa=
dding:0in'><b>From: </b><a href=3D"mailto:blitzrakete@gmail.com">Nicolas Le=
sser</a><br><b>Sent: </b>Sunday, April 15, 2018 9:19 AM<br><b>To: </b><a hr=
ef=3D"mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a><br><b>S=
ubject: </b>Re: [std-proposals] Lambda annotations</p></div><p class=3DMsoN=
ormal><o:p>&nbsp;</o:p></p><div><p class=3DMsoNormal>I don't think that tho=
se annotations should change the actual symbol generated, because that woul=
d mean that you could break the ABI by simply changing the name of the lamb=
da, and conflicts can happen quite quickly. I would rather see those names =
used as informal lambda name for debugging and error reporting messages.</p=
><div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=3DMsoNo=
rmal>Also, this was just an idea. Currently there is no way to do that, so =
it's just normal that in your case they don't do anything.</p></div></div><=
div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p><div><p class=3DMsoNormal>On =
Sun, Apr 15, 2018 at 6:14 PM, Ritwik Das &lt;<a href=3D"mailto:ritwik.sami1=
990@gmail.com" target=3D"_blank">ritwik.sami1990@gmail.com</a>&gt; wrote:</=
p><blockquote style=3D'border:none;border-left:solid #CCCCCC 1.0pt;padding:=
0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p class=3D=
MsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Stan=
dard attributes/implementation specific attributes do not help much in this=
 case but new attributes do not affect the compiler generated names I would=
 want symbols to be generated based on the given names. I tried something l=
ike this but the names are random regardless. What am I missing?</p><p clas=
s=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>=
&nbsp;</p><div><div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:a=
uto;mso-margin-bottom-alt:auto'><span style=3D'color:blue'>#include</span><=
span style=3D'color:black'> &lt;iostream&gt;</span></p></div><p class=3DMso=
Normal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<=
/p><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bo=
ttom-alt:auto'><span style=3D'color:blue'>template</span><span style=3D'col=
or:black'>&lt;</span><span style=3D'color:blue'>typename</span><span style=
=3D'color:black'> T&gt;</span></p></div><div><p class=3DMsoNormal style=3D'=
mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style=3D'color:bl=
ue'>void</span><span style=3D'color:black'> func(T&amp;&amp; lambda)</span>=
</p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-ma=
rgin-bottom-alt:auto'><span style=3D'color:black'>{</span></p></div><div><p=
 class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:a=
uto'><span style=3D'color:black'>&nbsp;&nbsp;&nbsp;&nbsp;lambda();</span></=
p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-marg=
in-bottom-alt:auto'><span style=3D'color:black'>}</span></p></div><p class=
=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&=
nbsp;</p><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-mar=
gin-bottom-alt:auto'><span style=3D'color:blue'>int</span><span style=3D'co=
lor:black'> main()</span></p></div><div><p class=3DMsoNormal style=3D'mso-m=
argin-top-alt:auto;mso-margin-bottom-alt:auto'><span style=3D'color:black'>=
{</span></p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:aut=
o;mso-margin-bottom-alt:auto'><span style=3D'color:black'>&nbsp;&nbsp;&nbsp=
;&nbsp;func([]()</span><span style=3D'color:gray'>[[cats::meow]]</span><spa=
n style=3D'color:black'> {std::cout &lt;&lt; </span><span style=3D'color:#A=
31515'>&quot;Hello!&quot;</span><span style=3D'color:black'>; });</span></p=
></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margi=
n-bottom-alt:auto'><span style=3D'color:black'>&nbsp;&nbsp;&nbsp;&nbsp;func=
([]() {std::cout &lt;&lt; </span><span style=3D'color:#A31515'>&quot;world!=
&quot;</span><span style=3D'color:black'>; });</span></p></div><div><p clas=
s=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>=
<span style=3D'color:black'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style=3D'c=
olor:blue'>return</span><span style=3D'color:black'> </span><span style=3D'=
color:#09885A'>0</span><span style=3D'color:black'>;</span></p></div><div><=
p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:=
auto'><span style=3D'color:black'>}</span></p></div><p class=3DMsoNormal st=
yle=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;</p></div>=
</div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bott=
om-alt:auto'>&nbsp;</p><p class=3DMsoNormal style=3D'mso-margin-top-alt:aut=
o;mso-margin-bottom-alt:auto'>&nbsp;</p><p class=3DMsoNormal style=3D'mso-m=
argin-top-alt:auto;mso-margin-bottom-alt:auto'>Sent from <a href=3D"https:/=
/go.microsoft.com/fwlink/?LinkId=3D550986" target=3D"_blank">Mail</a> for W=
indows 10</p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-marg=
in-bottom-alt:auto'>&nbsp;</p><div style=3D'border:none;border-top:solid #E=
1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=3DMsoNormal style=3D'mso-ma=
rgin-top-alt:auto;mso-margin-bottom-alt:auto'><b>From: </b><a href=3D"mailt=
o:blitzrakete@gmail.com" target=3D"_blank">Nicolas Lesser</a><br><b>Sent: <=
/b>Sunday, April 15, 2018 8:50 AM</p><div><div><p class=3DMsoNormal><br><b>=
To: </b><a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-p=
roposals@isocpp.org</a><br><b>Subject: </b>Re: [std-proposals] Lambda annot=
ations</p></div></div></div><div><div><p class=3DMsoNormal style=3D'mso-mar=
gin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;</p><div><p class=3DMsoN=
ormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Well, yo=
u could use either a new attribute or an implementation-defined attribute t=
o give the lambda a name for debugging/error reporting purposes.</p></div><=
div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom=
-alt:auto'>&nbsp;</p><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:=
auto;mso-margin-bottom-alt:auto'>On Sun, Apr 15, 2018 at 5:28 PM, Ritwik Da=
s &lt;<a href=3D"mailto:ritwik.sami1990@gmail.com" target=3D"_blank">ritwik=
..sami1990@gmail.com</a>&gt; wrote:</p><blockquote style=3D'border:none;bord=
er-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;mar=
gin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><p class=3DMs=
oNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>But I =
am still confused how attributes can solve the problems mentioned below?</p=
><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-al=
t:auto'>&nbsp;</p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso=
-margin-bottom-alt:auto'>Sent from <a href=3D"https://go.microsoft.com/fwli=
nk/?LinkId=3D550986" target=3D"_blank">Mail</a> for Windows 10</p><p class=
=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&=
nbsp;</p><div style=3D'border:none;border-top:solid #E1E1E1 1.0pt;padding:3=
..0pt 0in 0in 0in'><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso=
-margin-bottom-alt:auto'><b>From: </b><a href=3D"mailto:blitzrakete@gmail.c=
om" target=3D"_blank">Nicolas Lesser</a><br><b>Sent: </b>Sunday, April 15, =
2018 1:03 AM<br><b>To: </b><a href=3D"mailto:std-proposals@isocpp.org" targ=
et=3D"_blank">std-proposals@isocpp.org</a><br><b>Subject: </b>Re: [std-prop=
osals] Lambda annotations</p></div><div><div><p class=3DMsoNormal style=3D'=
mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;</p><div><p class=
=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>T=
here was a proposal or idea once to name lambdas to be able to name the lam=
bda inside the lambda, and the syntax exactly matches what you propose.</p>=
<div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-botto=
m-alt:auto'>&nbsp;</p></div><div><p class=3DMsoNormal style=3D'mso-margin-t=
op-alt:auto;mso-margin-bottom-alt:auto'>Currently you can use an attribute =
:).</p></div></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:au=
to;mso-margin-bottom-alt:auto'>&nbsp;</p><div><p class=3DMsoNormal style=3D=
'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>On Sun, Apr 15, 2018 a=
t 9:28 AM, Ritwik Das &lt;<a href=3D"mailto:ritwik.sami1990@gmail.com" targ=
et=3D"_blank">ritwik.sami1990@gmail.com</a>&gt; wrote:</p><blockquote style=
=3D'border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;m=
argin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><di=
v><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto'><span style=3D'font-size:13.5pt'>Problem:</span></p><div><p class=
=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>T=
he fact that lambda functions are by design unnamed means that the compiler=
 has to assign names which show up in the call stack while debugging and al=
so in dumps etc. This makes things especially difficult for automated tools=
 which categorize dumps based on the call stack because the compiler assign=
ed lambda names tend to change over time. Some specific problems which occu=
r because of the compiler assigning random names to lambda functions are ci=
ted below:</p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:a=
uto;mso-margin-bottom-alt:auto'>&nbsp;</p></div><div><p class=3DMsoNormal s=
tyle=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b>Example 1:</=
b></p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-=
margin-bottom-alt:auto'><u>Sample code:</u></p></div><div><div><p class=3DM=
soNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>templ=
ate&lt;typename T&gt;</p></div><div><p class=3DMsoNormal style=3D'mso-margi=
n-top-alt:auto;mso-margin-bottom-alt:auto'>int func(T&amp;&amp; lambda)</p>=
</div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin=
-bottom-alt:auto'>{</p></div><div><p class=3DMsoNormal style=3D'mso-margin-=
top-alt:auto;mso-margin-bottom-alt:auto'>lambda();</p></div><div><p class=
=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>}=
</p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-ma=
rgin-bottom-alt:auto'>&nbsp;</p></div><div><p class=3DMsoNormal style=3D'ms=
o-margin-top-alt:auto;mso-margin-bottom-alt:auto'>int main()</p></div><div>=
<p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto'>{</p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:aut=
o;mso-margin-bottom-alt:auto'>func([]() {std::cout &lt;&lt; &quot;Hello!&qu=
ot;; });</p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:aut=
o;mso-margin-bottom-alt:auto'>return 0;</p></div><div><p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>}</p></div></d=
iv><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bo=
ttom-alt:auto'>&nbsp;</p></div><div><p class=3DMsoNormal style=3D'mso-margi=
n-top-alt:auto;mso-margin-bottom-alt:auto'><u>Compiler Error:</u></p></div>=
<div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-=
bottom-alt:auto'>1&gt;lambda.cpp</p></div><div><p class=3DMsoNormal style=
=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>1&gt;\lambda.cpp(11=
): error C4716: 'func&lt;&lt;<b>lambda_4653923a58ae9d647caab6ef4f61a443</b>=
&gt; &gt;': must return a value</p></div></div><div><p class=3DMsoNormal st=
yle=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;</p></div>=
<div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-botto=
m-alt:auto'>Errors like this are hard to track because the error message do=
es not really identify the source of the problem.</p></div><div><p class=3D=
MsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbs=
p;</p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-=
margin-bottom-alt:auto'><b>Example 2:</b></p></div><div><div><p class=3DMso=
Normal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&gt; Cl=
assA::frame6 C++</p></div><div><p class=3DMsoNormal style=3D'mso-margin-top=
-alt:auto;mso-margin-bottom-alt:auto'>&nbsp; ClassA::frame4::<b>__l62::&lt;=
lambda&gt;</b> C++</p></div><div><p class=3DMsoNormal style=3D'mso-margin-t=
op-alt:auto;mso-margin-bottom-alt:auto'>&nbsp; ClassB::frame3&lt;lambda&gt;=
(void) &gt; C++</p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-=
alt:auto;mso-margin-bottom-alt:auto'>&nbsp; ClassA::frame2 C++</p></div><di=
v><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto'>&nbsp; ClassA::frame1 C++</p></div></div><div><p class=3DMsoNormal=
 style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;</p></d=
iv><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bo=
ttom-alt:auto'>In the above call stack, the lambda function is referred to =
as &quot;__l62&quot; which neither is very useful nor does this stay invari=
ant over time as more lambdas are added to the codebase (it is not even cle=
ar how this name is chosen by the compiler).</p></div><div><p class=3DMsoNo=
rmal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;</p=
></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margi=
n-bottom-alt:auto'><span style=3D'font-size:13.5pt'>Proposal:</span></p></d=
iv><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bo=
ttom-alt:auto'>If there is a way for optionally annotating lambda functions=
 with the declaration, the compiler can use this to produce lambda names mo=
re consistently. e.g. The strawman syntax can be something like: &quot;[=3D=
] <b>mylambda1</b>() {...}&quot;. This might seem counter-intuitive since l=
ambdas are defined to be <i>anonymous</i> functions, adding an optional ann=
otation to the lambda does not really take away the benefits of using lambd=
as over functions but rather makes it more powerful.</p></div><div><p class=
=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&=
nbsp;</p></div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;m=
so-margin-bottom-alt:auto'>P.S.:</p></div><div><p class=3DMsoNormal style=
=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Apologies if I miss=
ed proposals which addresses the above problem.</p></div></div><p class=3DM=
soNormal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span=
 class=3Dm6031191767155126304m4195605197699100460hoenzb><span style=3D'colo=
r:#888888'>-- </span></span><span style=3D'color:#888888'><br><span class=
=3Dm6031191767155126304m4195605197699100460hoenzb>You received this message=
 because you are subscribed to the Google Groups &quot;ISO C++ Standard - F=
uture Proposals&quot; group.</span><br><span class=3Dm6031191767155126304m4=
195605197699100460hoenzb>To unsubscribe from this group and stop receiving =
emails from it, send an email to <a href=3D"mailto:std-proposals+unsubscrib=
e@isocpp.org" target=3D"_blank">std-proposals+unsubscribe@isocpp.org</a>.</=
span><br><span class=3Dm6031191767155126304m4195605197699100460hoenzb>To po=
st to this group, send email to <a href=3D"mailto:std-proposals@isocpp.org"=
 target=3D"_blank">std-proposals@isocpp.org</a>.</span><br><span class=3Dm6=
031191767155126304m4195605197699100460hoenzb>To view this discussion on the=
 web visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-pr=
oposals/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=3Demai=
l&amp;utm_source=3Dfooter" target=3D"_blank">https://groups.google.com/a/is=
ocpp.org/d/msgid/std-proposals/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocp=
p.org</a>.</span></span></p></blockquote></div><p class=3DMsoNormal style=
=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;</p></div></d=
iv></div><div><div><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;ms=
o-margin-bottom-alt:auto'>-- <br>You received this message because you are =
subscribed to the Google Groups &quot;ISO C++ Standard - Future Proposals&q=
uot; group.<br>To unsubscribe from this group and stop receiving emails fro=
m it, send an email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.o=
rg" target=3D"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>To post =
to this group, send email to <a href=3D"mailto:std-proposals@isocpp.org" ta=
rget=3D"_blank">std-proposals@isocpp.org</a>.</p></div></div><p class=3DMso=
Normal style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>To view=
 this discussion on the web visit <a href=3D"https://groups.google.com/a/is=
ocpp.org/d/msgid/std-proposals/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h=
%2BJ0jjVgMw%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" ta=
rget=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-proposal=
s/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com<=
/a>.</p><p class=3DMsoNormal style=3D'mso-margin-top-alt:auto;mso-margin-bo=
ttom-alt:auto'>&nbsp;</p></div></div><p class=3DMsoNormal style=3D'mso-marg=
in-top-alt:auto;mso-margin-bottom-alt:auto'>-- <br>You received this messag=
e because you are subscribed to the Google Groups &quot;ISO C++ Standard - =
Future Proposals&quot; group.<br>To unsubscribe from this group and stop re=
ceiving emails from it, send an email to <a href=3D"mailto:std-proposals+un=
subscribe@isocpp.org" target=3D"_blank">std-proposals+unsubscribe@isocpp.or=
g</a>.<br>To post to this group, send email to <a href=3D"mailto:std-propos=
als@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>To view =
this discussion on the web visit <a href=3D"https://groups.google.com/a/iso=
cpp.org/d/msgid/std-proposals/5ad36f81.c614620a.ddf08.2250%40mx.google.com?=
utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">https://group=
s.google.com/a/isocpp.org/d/msgid/std-proposals/5ad36f81.c614620a.ddf08.225=
0%40mx.google.com</a>.</p></blockquote></div><p class=3DMsoNormal style=3D'=
mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;</p></div></div><=
/div><div><div><p class=3DMsoNormal>-- <br>You received this message becaus=
e you are subscribed to the Google Groups &quot;ISO C++ Standard - Future P=
roposals&quot; group.<br>To unsubscribe from this group and stop receiving =
emails from it, send an email to <a href=3D"mailto:std-proposals+unsubscrib=
e@isocpp.org" target=3D"_blank">std-proposals+unsubscribe@isocpp.org</a>.<b=
r>To post to this group, send email to <a href=3D"mailto:std-proposals@isoc=
pp.org" target=3D"_blank">std-proposals@isocpp.org</a>.</p></div></div><p c=
lass=3DMsoNormal>To view this discussion on the web visit <a href=3D"https:=
//groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq1oGuP3Bj3AfHV=
nJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com?utm_medium=3Demail&amp=
;utm_source=3Dfooter" target=3D"_blank">https://groups.google.com/a/isocpp.=
org/d/msgid/std-proposals/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByL=
iz1oJg%40mail.gmail.com</a>.</p><p class=3DMsoNormal style=3D'mso-margin-to=
p-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;</p></div></div><p class=3DMso=
Normal>-- <br>You received this message because you are subscribed to the G=
oogle Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br>To u=
nsubscribe from this group and stop receiving emails from it, send an email=
 to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blan=
k">std-proposals+unsubscribe@isocpp.org</a>.<br>To post to this group, send=
 email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std=
-proposals@isocpp.org</a>.<br>To view this discussion on the web visit <a h=
ref=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad37a5=
f.d164650a.b857a.760b%40mx.google.com?utm_medium=3Demail&amp;utm_source=3Df=
ooter" target=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std=
-proposals/5ad37a5f.d164650a.b857a.760b%40mx.google.com</a>.</p></blockquot=
e></div><p class=3DMsoNormal><o:p>&nbsp;</o:p></p></div><p class=3DMsoNorma=
l>-- <br>You received this message because you are subscribed to the Google=
 Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br>To unsubs=
cribe from this group and stop receiving emails from it, send an email to <=
a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubs=
cribe@isocpp.org</a>.<br>To post to this group, send email to <a href=3D"ma=
ilto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br>To view thi=
s discussion on the web visit <a href=3D"https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CALmDwq0tZUjRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVu=
Ex68%3DNQ%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter">http=
s://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq0tZUjRMpD7i=
_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68%3DNQ%40mail.gmail.com</a>.</p><p class=
=3DMsoNormal><o:p>&nbsp;</o:p></p></div></body></html>

<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/5ad38837.435a620a.8b39e.a4c7%40mx.goo=
gle.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/a=
/isocpp.org/d/msgid/std-proposals/5ad38837.435a620a.8b39e.a4c7%40mx.google.=
com</a>.<br />

--_E168E463-16A1-4E99-AFEE-FE8633C4C865_--


.


Author: Nicolas Lesser <blitzrakete@gmail.com>
Date: Sun, 15 Apr 2018 19:19:10 +0200
Raw View
--000000000000b4ef860569e64d4b
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Okay, makes sense. Then you might want to look at P0839
<http://wg21.link/p0839>, which proposes exactly the same thing. In that
case, you're right: Attributes are the wrong feature to use for your
proposal.

Note: That paper was never discussed in Albuquerque, and it never came
back. Maybe ask the author?

On Sun, Apr 15, 2018 at 7:13 PM, Ritwik Das <ritwik.sami1990@gmail.com>
wrote:

> Isn=E2=80=99t that the same behavior when someone changes regular functio=
n names,
> symbols for which depend on the given names based on some predefined
> mangling rules. I don=E2=80=99t want this to be any different for lambdas=
 and that
> is what this proposal is about=E2=80=A6
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=3D550986> for
> Windows 10
>
>
>
> *From: *Nicolas Lesser <blitzrakete@gmail.com>
> *Sent: *Sunday, April 15, 2018 9:19 AM
>
> *To: *std-proposals@isocpp.org
> *Subject: *Re: [std-proposals] Lambda annotations
>
>
>
> I don't think that those annotations should change the actual symbol
> generated, because that would mean that you could break the ABI by simply
> changing the name of the lambda, and conflicts can happen quite quickly. =
I
> would rather see those names used as informal lambda name for debugging a=
nd
> error reporting messages.
>
>
>
> Also, this was just an idea. Currently there is no way to do that, so it'=
s
> just normal that in your case they don't do anything.
>
>
>
> On Sun, Apr 15, 2018 at 6:14 PM, Ritwik Das <ritwik.sami1990@gmail.com>
> wrote:
>
> Standard attributes/implementation specific attributes do not help much i=
n
> this case but new attributes do not affect the compiler generated names I
> would want symbols to be generated based on the given names. I tried
> something like this but the names are random regardless. What am I missin=
g?
>
>
>
> #include <iostream>
>
>
>
> template<typename T>
>
> void func(T&& lambda)
>
> {
>
>     lambda();
>
> }
>
>
>
> int main()
>
> {
>
>     func([]()[[cats::meow]] {std::cout << "Hello!"; });
>
>     func([]() {std::cout << "world!"; });
>
>     return 0;
>
> }
>
>
>
>
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=3D550986> for
> Windows 10
>
>
>
> *From: *Nicolas Lesser <blitzrakete@gmail.com>
> *Sent: *Sunday, April 15, 2018 8:50 AM
>
>
> *To: *std-proposals@isocpp.org
> *Subject: *Re: [std-proposals] Lambda annotations
>
>
>
> Well, you could use either a new attribute or an implementation-defined
> attribute to give the lambda a name for debugging/error reporting purpose=
s.
>
>
>
> On Sun, Apr 15, 2018 at 5:28 PM, Ritwik Das <ritwik.sami1990@gmail.com>
> wrote:
>
> But I am still confused how attributes can solve the problems mentioned
> below?
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=3D550986> for
> Windows 10
>
>
>
> *From: *Nicolas Lesser <blitzrakete@gmail.com>
> *Sent: *Sunday, April 15, 2018 1:03 AM
> *To: *std-proposals@isocpp.org
> *Subject: *Re: [std-proposals] Lambda annotations
>
>
>
> There was a proposal or idea once to name lambdas to be able to name the
> lambda inside the lambda, and the syntax exactly matches what you propose=
..
>
>
>
> Currently you can use an attribute :).
>
>
>
> On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das <ritwik.sami1990@gmail.com>
> wrote:
>
> Problem:
>
> The fact that lambda functions are by design unnamed means that the
> compiler has to assign names which show up in the call stack while
> debugging and also in dumps etc. This makes things especially difficult f=
or
> automated tools which categorize dumps based on the call stack because th=
e
> compiler assigned lambda names tend to change over time. Some specific
> problems which occur because of the compiler assigning random names to
> lambda functions are cited below:
>
>
>
> *Example 1:*
>
> *Sample code:*
>
> template<typename T>
>
> int func(T&& lambda)
>
> {
>
> lambda();
>
> }
>
>
>
> int main()
>
> {
>
> func([]() {std::cout << "Hello!"; });
>
> return 0;
>
> }
>
>
>
> *Compiler Error:*
>
> 1>lambda.cpp
>
> 1>\lambda.cpp(11): error C4716: 'func<<
> *lambda_4653923a58ae9d647caab6ef4f61a443*> >': must return a value
>
>
>
> Errors like this are hard to track because the error message does not
> really identify the source of the problem.
>
>
>
> *Example 2:*
>
> > ClassA::frame6 C++
>
>   ClassA::frame4::*__l62::<lambda>* C++
>
>   ClassB::frame3<lambda>(void) > C++
>
>   ClassA::frame2 C++
>
>   ClassA::frame1 C++
>
>
>
> In the above call stack, the lambda function is referred to as "__l62"
> which neither is very useful nor does this stay invariant over time as mo=
re
> lambdas are added to the codebase (it is not even clear how this name is
> chosen by the compiler).
>
>
>
> Proposal:
>
> If there is a way for optionally annotating lambda functions with the
> declaration, the compiler can use this to produce lambda names more
> consistently. e.g. The strawman syntax can be something like: "[=3D]
> *mylambda1*() {...}". This might seem counter-intuitive since lambdas are
> defined to be *anonymous* functions, adding an optional annotation to the
> lambda does not really take away the benefits of using lambdas over
> functions but rather makes it more powerful.
>
>
>
> P.S.:
>
> Apologies if I missed proposals which addresses the above problem.
>
> --
> 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/5225897d-fa81-4137-
> 928d-f97fcb4f2efe%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5225897d-fa=
81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>
>
>
> --
> 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/CALmDwq2sdDK05--
> 85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq2sdD=
K05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com?utm_medium=3D=
email&utm_source=3Dfooter>
> .
>
>
>
> --
> 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/5ad36f81.c614620a.
> ddf08.2250%40mx.google.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad36f81.c6=
14620a.ddf08.2250%40mx.google.com?utm_medium=3Demail&utm_source=3Dfooter>
> .
>
>
>
> --
> 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/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZ
> Z%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq1oGu=
P3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com?utm_medium=3D=
email&utm_source=3Dfooter>
> .
>
>
>
> --
> 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/5ad37a5f.d164650a.
> b857a.760b%40mx.google.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad37a5f.d1=
64650a.b857a.760b%40mx.google.com?utm_medium=3Demail&utm_source=3Dfooter>
> .
>
>
>
> --
> 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/CALmDwq0tZUjRMpD7i_pwKS_G2%2BgvwCH5T%
> 2BaJEypujVuEx68%3DNQ%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq0tZU=
jRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68%3DNQ%40mail.gmail.com?utm_medium=
=3Demail&utm_source=3Dfooter>
> .
>
>
>
> --
> 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/5ad38837.435a620a.
> 8b39e.a4c7%40mx.google.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad38837.43=
5a620a.8b39e.a4c7%40mx.google.com?utm_medium=3Demail&utm_source=3Dfooter>
> .
>

--=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/CALmDwq3%2BGLacfpvzPE%2BfW_cYrUnw88%3Dmg40OBGEni=
Hw287%2Bz2Q%40mail.gmail.com.

--000000000000b4ef860569e64d4b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Okay, makes sense. Then you might want to look at=C2=A0<a =
href=3D"http://wg21.link/p0839">P0839</a>, which proposes exactly the same =
thing. In that case, you&#39;re right: Attributes are the wrong feature to =
use for your proposal.<div><br></div><div>Note: That paper was never discus=
sed in Albuquerque, and it never came back. Maybe ask the author?=C2=A0</di=
v></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Sun, A=
pr 15, 2018 at 7:13 PM, Ritwik Das <span dir=3D"ltr">&lt;<a href=3D"mailto:=
ritwik.sami1990@gmail.com" target=3D"_blank">ritwik.sami1990@gmail.com</a>&=
gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 =
0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang=3D"EN-US" lin=
k=3D"blue" vlink=3D"#954F72"><div class=3D"m_8384118837586847347WordSection=
1"><p class=3D"MsoNormal">Isn=E2=80=99t that the same behavior when someone=
 changes regular function names, symbols for which depend on the given name=
s based on some predefined mangling rules. I don=E2=80=99t want this to be =
any different for lambdas and that is what this proposal is about=E2=80=A6<=
/p><span class=3D""><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><p class=
=3D"MsoNormal">Sent from <a href=3D"https://go.microsoft.com/fwlink/?LinkId=
=3D550986" target=3D"_blank">Mail</a> for Windows 10</p><p class=3D"MsoNorm=
al"><u></u>=C2=A0<u></u></p></span><div style=3D"border:none;border-top:sol=
id #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class=3D"MsoNormal" style=3D=
"border:none;padding:0in"><b>From: </b><a href=3D"mailto:blitzrakete@gmail.=
com" target=3D"_blank">Nicolas Lesser</a><br><b>Sent: </b>Sunday, April 15,=
 2018 9:19 AM</p><div><div class=3D"h5"><br><b>To: </b><a href=3D"mailto:st=
d-proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a><br><=
b>Subject: </b>Re: [std-proposals] Lambda annotations</div></div><p></p></d=
iv><div><div class=3D"h5"><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><d=
iv><p class=3D"MsoNormal">I don&#39;t think that those annotations should c=
hange the actual symbol generated, because that would mean that you could b=
reak the ABI by simply changing the name of the lambda, and conflicts can h=
appen quite quickly. I would rather see those names used as informal lambda=
 name for debugging and error reporting messages.</p><div><p class=3D"MsoNo=
rmal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"MsoNormal">Also, this =
was just an idea. Currently there is no way to do that, so it&#39;s just no=
rmal that in your case they don&#39;t do anything.</p></div></div><div><p c=
lass=3D"MsoNormal"><u></u>=C2=A0<u></u></p><div><p class=3D"MsoNormal">On S=
un, Apr 15, 2018 at 6:14 PM, Ritwik Das &lt;<a href=3D"mailto:ritwik.sami19=
90@gmail.com" target=3D"_blank">ritwik.sami1990@gmail.com</a>&gt; wrote:</p=
><blockquote style=3D"border:none;border-left:solid #cccccc 1.0pt;padding:0=
in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"><div><div><p class=3D"=
MsoNormal">Standard attributes/implementation specific attributes do not he=
lp much in this case but new attributes do not affect the compiler generate=
d names I would want symbols to be generated based on the given names. I tr=
ied something like this but the names are random regardless. What am I miss=
ing?</p><p class=3D"MsoNormal">=C2=A0</p><div><div><div><p class=3D"MsoNorm=
al"><span style=3D"color:blue">#include</span><span style=3D"color:black"> =
&lt;iostream&gt;</span></p></div><p class=3D"MsoNormal">=C2=A0</p><div><p c=
lass=3D"MsoNormal"><span style=3D"color:blue">template</span><span style=3D=
"color:black">&lt;</span><span style=3D"color:blue">typename</span><span st=
yle=3D"color:black"> T&gt;</span></p></div><div><p class=3D"MsoNormal"><spa=
n style=3D"color:blue">void</span><span style=3D"color:black"> func(T&amp;&=
amp; lambda)</span></p></div><div><p class=3D"MsoNormal"><span style=3D"col=
or:black">{</span></p></div><div><p class=3D"MsoNormal"><span style=3D"colo=
r:black">=C2=A0=C2=A0=C2=A0=C2=A0lambda();</span></p></div><div><p class=3D=
"MsoNormal"><span style=3D"color:black">}</span></p></div><p class=3D"MsoNo=
rmal">=C2=A0</p><div><p class=3D"MsoNormal"><span style=3D"color:blue">int<=
/span><span style=3D"color:black"> main()</span></p></div><div><p class=3D"=
MsoNormal"><span style=3D"color:black">{</span></p></div><div><p class=3D"M=
soNormal"><span style=3D"color:black">=C2=A0=C2=A0=C2=A0=C2=A0func([]()</sp=
an><span style=3D"color:gray">[[cats::meow]]</span><span style=3D"color:bla=
ck"> {std::cout &lt;&lt; </span><span style=3D"color:#a31515">&quot;Hello!&=
quot;</span><span style=3D"color:black">; });</span></p></div><div><p class=
=3D"MsoNormal"><span style=3D"color:black">=C2=A0=C2=A0=C2=A0=C2=A0func([](=
) {std::cout &lt;&lt; </span><span style=3D"color:#a31515">&quot;world!&quo=
t;</span><span style=3D"color:black">; });</span></p></div><div><p class=3D=
"MsoNormal"><span style=3D"color:black">=C2=A0=C2=A0=C2=A0=C2=A0</span><spa=
n style=3D"color:blue">return</span><span style=3D"color:black"> </span><sp=
an style=3D"color:#09885a">0</span><span style=3D"color:black">;</span></p>=
</div><div><p class=3D"MsoNormal"><span style=3D"color:black">}</span></p><=
/div><p class=3D"MsoNormal">=C2=A0</p></div></div><p class=3D"MsoNormal">=
=C2=A0</p><p class=3D"MsoNormal">=C2=A0</p><p class=3D"MsoNormal">Sent from=
 <a href=3D"https://go.microsoft.com/fwlink/?LinkId=3D550986" target=3D"_bl=
ank">Mail</a> for Windows 10</p><p class=3D"MsoNormal">=C2=A0</p><div style=
=3D"border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><=
p class=3D"MsoNormal"><b>From: </b><a href=3D"mailto:blitzrakete@gmail.com"=
 target=3D"_blank">Nicolas Lesser</a><br><b>Sent: </b>Sunday, April 15, 201=
8 8:50 AM</p><div><div><p class=3D"MsoNormal"><br><b>To: </b><a href=3D"mai=
lto:std-proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a=
><br><b>Subject: </b>Re: [std-proposals] Lambda annotations</p></div></div>=
</div><div><div><p class=3D"MsoNormal">=C2=A0</p><div><p class=3D"MsoNormal=
">Well, you could use either a new attribute or an implementation-defined a=
ttribute to give the lambda a name for debugging/error reporting purposes.<=
/p></div><div><p class=3D"MsoNormal">=C2=A0</p><div><p class=3D"MsoNormal">=
On Sun, Apr 15, 2018 at 5:28 PM, Ritwik Das &lt;<a href=3D"mailto:ritwik.sa=
mi1990@gmail.com" target=3D"_blank">ritwik.sami1990@gmail.com</a>&gt; wrote=
:</p><blockquote style=3D"border:none;border-left:solid #cccccc 1.0pt;paddi=
ng:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;ma=
rgin-bottom:5.0pt"><div><div><p class=3D"MsoNormal">But I am still confused=
 how attributes can solve the problems mentioned below?</p><p class=3D"MsoN=
ormal">=C2=A0</p><p class=3D"MsoNormal">Sent from <a href=3D"https://go.mic=
rosoft.com/fwlink/?LinkId=3D550986" target=3D"_blank">Mail</a> for Windows =
10</p><p class=3D"MsoNormal">=C2=A0</p><div style=3D"border:none;border-top=
:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class=3D"MsoNormal"><b>F=
rom: </b><a href=3D"mailto:blitzrakete@gmail.com" target=3D"_blank">Nicolas=
 Lesser</a><br><b>Sent: </b>Sunday, April 15, 2018 1:03 AM<br><b>To: </b><a=
 href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-proposals@i=
socpp.org</a><br><b>Subject: </b>Re: [std-proposals] Lambda annotations</p>=
</div><div><div><p class=3D"MsoNormal">=C2=A0</p><div><p class=3D"MsoNormal=
">There was a proposal or idea once to name lambdas to be able to name the =
lambda inside the lambda, and the syntax exactly matches what you propose.<=
/p><div><p class=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNormal">=
Currently you can use an attribute :).</p></div></div><div><p class=3D"MsoN=
ormal">=C2=A0</p><div><p class=3D"MsoNormal">On Sun, Apr 15, 2018 at 9:28 A=
M, Ritwik Das &lt;<a href=3D"mailto:ritwik.sami1990@gmail.com" target=3D"_b=
lank">ritwik.sami1990@gmail.com</a>&gt; wrote:</p><blockquote style=3D"bord=
er:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-le=
ft:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt"><div><p cla=
ss=3D"MsoNormal"><span style=3D"font-size:13.5pt">Problem:</span></p><div><=
p class=3D"MsoNormal">The fact that lambda functions are by design unnamed =
means that the compiler has to assign names which show up in the call stack=
 while debugging and also in dumps etc. This makes things especially diffic=
ult for automated tools which categorize dumps based on the call stack beca=
use the compiler assigned lambda names tend to change over time. Some speci=
fic problems which occur because of the compiler assigning random names to =
lambda functions are cited below:</p></div><div><p class=3D"MsoNormal">=C2=
=A0</p></div><div><p class=3D"MsoNormal"><b>Example 1:</b></p></div><div><p=
 class=3D"MsoNormal"><u>Sample code:</u></p></div><div><div><p class=3D"Mso=
Normal">template&lt;typename T&gt;</p></div><div><p class=3D"MsoNormal">int=
 func(T&amp;&amp; lambda)</p></div><div><p class=3D"MsoNormal">{</p></div><=
div><p class=3D"MsoNormal">lambda();</p></div><div><p class=3D"MsoNormal">}=
</p></div><div><p class=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoN=
ormal">int main()</p></div><div><p class=3D"MsoNormal">{</p></div><div><p c=
lass=3D"MsoNormal">func([]() {std::cout &lt;&lt; &quot;Hello!&quot;; });</p=
></div><div><p class=3D"MsoNormal">return 0;</p></div><div><p class=3D"MsoN=
ormal">}</p></div></div><div><p class=3D"MsoNormal">=C2=A0</p></div><div><p=
 class=3D"MsoNormal"><u>Compiler Error:</u></p></div><div><div><p class=3D"=
MsoNormal">1&gt;lambda.cpp</p></div><div><p class=3D"MsoNormal">1&gt;\lambd=
a.cpp(11): error C4716: &#39;func&lt;&lt;<b>lambda_<wbr>4653923a58ae9d647ca=
ab6ef4f61a4<wbr>43</b>&gt; &gt;&#39;: must return a value</p></div></div><d=
iv><p class=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNormal">Error=
s like this are hard to track because the error message does not really ide=
ntify the source of the problem.</p></div><div><p class=3D"MsoNormal">=C2=
=A0</p></div><div><p class=3D"MsoNormal"><b>Example 2:</b></p></div><div><d=
iv><p class=3D"MsoNormal">&gt; ClassA::frame6 C++</p></div><div><p class=3D=
"MsoNormal">=C2=A0 ClassA::frame4::<b>__l62::&lt;<wbr>lambda&gt;</b> C++</p=
></div><div><p class=3D"MsoNormal">=C2=A0 ClassB::frame3&lt;lambda&gt;(void=
) &gt; C++</p></div><div><p class=3D"MsoNormal">=C2=A0 ClassA::frame2 C++</=
p></div><div><p class=3D"MsoNormal">=C2=A0 ClassA::frame1 C++</p></div></di=
v><div><p class=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNormal">I=
n the above call stack, the lambda function is referred to as &quot;__l62&q=
uot; which neither is very useful nor does this stay invariant over time as=
 more lambdas are added to the codebase (it is not even clear how this name=
 is chosen by the compiler).</p></div><div><p class=3D"MsoNormal">=C2=A0</p=
></div><div><p class=3D"MsoNormal"><span style=3D"font-size:13.5pt">Proposa=
l:</span></p></div><div><p class=3D"MsoNormal">If there is a way for option=
ally annotating lambda functions with the declaration, the compiler can use=
 this to produce lambda names more consistently. e.g. The strawman syntax c=
an be something like: &quot;[=3D] <b>mylambda1</b>() {...}&quot;. This migh=
t seem counter-intuitive since lambdas are defined to be <i>anonymous</i> f=
unctions, adding an optional annotation to the lambda does not really take =
away the benefits of using lambdas over functions but rather makes it more =
powerful.</p></div><div><p class=3D"MsoNormal">=C2=A0</p></div><div><p clas=
s=3D"MsoNormal">P.S.:</p></div><div><p class=3D"MsoNormal">Apologies if I m=
issed proposals which addresses the above problem.</p></div></div><p class=
=3D"MsoNormal"><span class=3D"m_8384118837586847347m6031191767155126304m419=
5605197699100460hoenzb"><span style=3D"color:#888888">-- </span></span><spa=
n style=3D"color:#888888"><br><span class=3D"m_8384118837586847347m60311917=
67155126304m4195605197699100460hoenzb">You received this message because yo=
u are subscribed to the Google Groups &quot;ISO C++ Standard - Future Propo=
sals&quot; group.</span><br><span class=3D"m_8384118837586847347m6031191767=
155126304m4195605197699100460hoenzb">To unsubscribe from this group and sto=
p receiving emails from it, send an email to <a href=3D"mailto:std-proposal=
s+unsubscribe@isocpp.org" target=3D"_blank">std-proposals+unsubscribe@<wbr>=
isocpp.org</a>.</span><br><span class=3D"m_8384118837586847347m603119176715=
5126304m4195605197699100460hoenzb">To post to this group, send email to <a =
href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-proposals@is=
ocpp.org</a>.</span><br><span class=3D"m_8384118837586847347m60311917671551=
26304m4195605197699100460hoenzb">To view this discussion on the web visit <=
a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5225=
897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=3Demail&amp;utm_so=
urce=3Dfooter" target=3D"_blank">https://groups.google.com/a/<wbr>isocpp.or=
g/d/msgid/std-<wbr>proposals/5225897d-fa81-4137-<wbr>928d-f97fcb4f2efe%40is=
ocpp.org</a><wbr>.</span></span></p></blockquote></div><p class=3D"MsoNorma=
l">=C2=A0</p></div></div></div><div><div><p class=3D"MsoNormal">-- <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 th=
is group and stop receiving emails from it, send an email to <a href=3D"mai=
lto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank">std-proposals+u=
nsubscribe@<wbr>isocpp.org</a>.<br>To post to this group, send email to <a =
href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-proposals@is=
ocpp.org</a>.</p></div></div><p class=3D"MsoNormal">To view this discussion=
 on the web visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid=
/std-proposals/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40ma=
il.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/CALm=
Dwq2sdDK05--<wbr>85eo%3DeNRceVjqRA1-W7DLVof0h%<wbr>2BJ0jjVgMw%40mail.gmail.=
com</a>.</p><p class=3D"MsoNormal">=C2=A0</p></div></div><p class=3D"MsoNor=
mal">-- <br>You received this message because you are subscribed to the Goo=
gle Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br>To uns=
ubscribe from this group and stop receiving emails from it, send an email t=
o <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank"=
>std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>To post to this group, s=
end email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">=
std-proposals@isocpp.org</a>.<br>To view this discussion on the web visit <=
a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad3=
6f81.c614620a.ddf08.2250%40mx.google.com?utm_medium=3Demail&amp;utm_source=
=3Dfooter" target=3D"_blank">https://groups.google.com/a/<wbr>isocpp.org/d/=
msgid/std-<wbr>proposals/5ad36f81.c614620a.<wbr>ddf08.2250%40mx.google.com<=
/a>.</p></blockquote></div><p class=3D"MsoNormal">=C2=A0</p></div></div></d=
iv><div><div><p class=3D"MsoNormal">-- <br>You received this message becaus=
e you are subscribed to the Google Groups &quot;ISO C++ Standard - Future P=
roposals&quot; group.<br>To unsubscribe from this group and stop receiving =
emails from it, send an email to <a href=3D"mailto:std-proposals+unsubscrib=
e@isocpp.org" target=3D"_blank">std-proposals+unsubscribe@<wbr>isocpp.org</=
a>.<br>To post to this group, send email to <a href=3D"mailto:std-proposals=
@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a>.</p></div></div=
><p class=3D"MsoNormal">To view this discussion on the web visit <a href=3D=
"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq1oGuP3=
Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com?utm_medium=3Dem=
ail&amp;utm_source=3Dfooter" target=3D"_blank">https://groups.google.com/a/=
<wbr>isocpp.org/d/msgid/std-<wbr>proposals/<wbr>CALmDwq1oGuP3Bj3AfHVnJK2eoz=
RWZ<wbr>Z%3DOjf6AQaQPB%2ByLiz1oJg%<wbr>40mail.gmail.com</a>.</p><p class=3D=
"MsoNormal">=C2=A0</p></div></div><p class=3D"MsoNormal">-- <br>You receive=
d this message because you are subscribed to the Google Groups &quot;ISO C+=
+ Standard - Future Proposals&quot; group.<br>To unsubscribe from this grou=
p and stop receiving emails from it, send an email to <a href=3D"mailto:std=
-proposals+unsubscribe@isocpp.org" target=3D"_blank">std-proposals+unsubscr=
ibe@<wbr>isocpp.org</a>.<br>To post to this group, send email to <a href=3D=
"mailto:std-proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.or=
g</a>.<br>To view this discussion on the web visit <a href=3D"https://group=
s.google.com/a/isocpp.org/d/msgid/std-proposals/5ad37a5f.d164650a.b857a.760=
b%40mx.google.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_bl=
ank">https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals=
/5ad37a5f.d164650a.<wbr>b857a.760b%40mx.google.com</a>.</p></blockquote></d=
iv><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div></div></div><p clas=
s=3D"MsoNormal"></p><div><div class=3D"h5">-- <br>You received this message=
 because you are subscribed to the Google Groups &quot;ISO C++ Standard - F=
uture Proposals&quot; group.<br>To unsubscribe from this group and stop rec=
eiving emails from it, send an email to <a href=3D"mailto:std-proposals+uns=
ubscribe@isocpp.org" target=3D"_blank">std-proposals+unsubscribe@<wbr>isocp=
p.org</a>.<br>To post to this group, send email to <a href=3D"mailto:std-pr=
oposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></di=
v></div>To view this discussion on the web visit <a href=3D"https://groups.=
google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq0tZUjRMpD7i_pwKS_G2%2B=
gvwCH5T%2BaJEypujVuEx68%3DNQ%40mail.gmail.com?utm_medium=3Demail&amp;utm_so=
urce=3Dfooter" target=3D"_blank">https://groups.google.com/a/<wbr>isocpp.or=
g/d/msgid/std-<wbr>proposals/CALmDwq0tZUjRMpD7i_<wbr>pwKS_G2%2BgvwCH5T%<wbr=
>2BaJEypujVuEx68%3DNQ%40mail.<wbr>gmail.com</a>.<p></p><p class=3D"MsoNorma=
l"><u></u>=C2=A0<u></u></p></div></div><span class=3D"">

<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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/5ad38837.435a620a.8b39e.a4c7%40mx.goo=
gle.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">https=
://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/5ad38837.=
435a620a.<wbr>8b39e.a4c7%40mx.google.com</a>.<br>
</blockquote></div><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/CALmDwq3%2BGLacfpvzPE%2BfW_cYrUnw88%3=
Dmg40OBGEniHw287%2Bz2Q%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoo=
ter">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq3%=
2BGLacfpvzPE%2BfW_cYrUnw88%3Dmg40OBGEniHw287%2Bz2Q%40mail.gmail.com</a>.<br=
 />

--000000000000b4ef860569e64d4b--

.


Author: Tony V E <tvaneerd@gmail.com>
Date: Sun, 15 Apr 2018 13:20:43 -0400
Raw View
<html><head></head><body lang=3D"en-US" link=3D"blue" vlink=3D"#954F72" sty=
le=3D"background-color: rgb(255, 255, 255); line-height: initial;">        =
                                                                           =
   <div style=3D"width: 100%; font-size: initial; font-family: Calibri, 'Sl=
ate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: init=
ial; background-color: rgb(255, 255, 255);">If you could name. Lambda, it w=
ouldn't change how the rest of the code is written (ie you wouldn't use the=
 name to call the lambda) nor how the code works.&nbsp;</div><div style=3D"=
width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-se=
rif, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-c=
olor: rgb(255, 255, 255);"><br></div><div style=3D"width: 100%; font-size: =
initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: =
rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255)=
;">So from the standard's point of view, the name does nothing. It isn't re=
ally =E2=80=8Epart of the language or the abstract machine.</div><div style=
=3D"width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', san=
s-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; backgrou=
nd-color: rgb(255, 255, 255);"><br></div><div style=3D"width: 100%; font-si=
ze: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; col=
or: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, =
255);">It would only affect debugging, etc. Which is beyond what the standa=
rd talks about.</div><div style=3D"width: 100%; font-size: initial; font-fa=
mily: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125)=
; text-align: initial; background-color: rgb(255, 255, 255);"><br></div><di=
v style=3D"width: 100%; font-size: initial; font-family: Calibri, 'Slate Pr=
o', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; b=
ackground-color: rgb(255, 255, 255);">So attributes would be the right tool=
 of choice here. They have the same properties.&nbsp;</div><div style=3D"wi=
dth: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-seri=
f, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-col=
or: rgb(255, 255, 255);"><br></div><div style=3D"width: 100%; font-size: in=
itial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rg=
b(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"=
>ie something like [[name:foo]]. Maybe we could also use the same attribute=
 for naming threads (which has been requested for the same reason: debuggin=
g) </div>                                                                  =
                                                                   <div sty=
le=3D"width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', s=
ans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; backgr=
ound-color: rgb(255, 255, 255);"><br style=3D"display:initial"></div>      =
                                                                           =
                                                                           =
                                       <div style=3D"font-size: initial; fo=
nt-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73,=
 125); text-align: initial; background-color: rgb(255, 255, 255);">Sent&nbs=
p;from&nbsp;my&nbsp;BlackBerry&nbsp;portable&nbsp;Babbage&nbsp;Device</div>=
                                                                           =
                                                                           =
                            <table width=3D"100%" style=3D"background-color=
:white;border-spacing:0px;"> <tbody><tr><td colspan=3D"2" style=3D"font-siz=
e: initial; text-align: initial; background-color: rgb(255, 255, 255);">   =
                        <div style=3D"border-style: solid none none; border=
-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0in 0in=
; font-family: Tahoma, 'BB Alpha Sans', 'Slate Pro'; font-size: 10pt;">  <d=
iv><b>From: </b>Ritwik Das</div><div><b>Sent: </b>Sunday, April 15, 2018 1:=
13 PM</div><div><b>To: </b>std-proposals@isocpp.org</div><div><b>Reply To: =
</b>std-proposals@isocpp.org</div><div><b>Subject: </b>RE: [std-proposals] =
Lambda annotations</div></div></td></tr></tbody></table><div style=3D"borde=
r-style: solid none none; border-top-color: rgb(186, 188, 209); border-top-=
width: 1pt; font-size: initial; text-align: initial; background-color: rgb(=
255, 255, 255);"></div><br><div id=3D"_originalContent" style=3D""><meta ht=
tp-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8"><meta name=
=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
 {font-family:"Cambria Math";
 panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
 {font-family:Calibri;
 panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
 {margin:0in;
 margin-bottom:.0001pt;
 font-size:11.0pt;
 font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
 {mso-style-priority:99;
 color:blue;
 text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
 {mso-style-priority:99;
 color:#954F72;
 text-decoration:underline;}
span.m6031191767155126304m4195605197699100460hoenzb
 {mso-style-name:m_6031191767155126304m4195605197699100460hoenzb;}
..MsoChpDefault
 {mso-style-type:export-only;}
@page WordSection1
 {size:8.5in 11.0in;
 margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
 {page:WordSection1;}
--></style><div class=3D"WordSection1"><p class=3D"MsoNormal">Isn=E2=80=99t=
 that the same behavior when someone changes regular function names, symbol=
s for which depend on the given names based on some predefined mangling rul=
es. I don=E2=80=99t want this to be any different for lambdas and that is w=
hat this proposal is about=E2=80=A6</p><p class=3D"MsoNormal"><o:p>&nbsp;</=
o:p></p><p class=3D"MsoNormal">Sent from <a href=3D"https://go.microsoft.co=
m/fwlink/?LinkId=3D550986">Mail</a> for Windows 10</p><p class=3D"MsoNormal=
"><o:p>&nbsp;</o:p></p><div style=3D"mso-element:para-border-div;border:non=
e;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in"><p class=3D"Mso=
Normal" style=3D"border:none;padding:0in"><b>From: </b><a href=3D"mailto:bl=
itzrakete@gmail.com">Nicolas Lesser</a><br><b>Sent: </b>Sunday, April 15, 2=
018 9:19 AM<br><b>To: </b><a href=3D"mailto:std-proposals@isocpp.org">std-p=
roposals@isocpp.org</a><br><b>Subject: </b>Re: [std-proposals] Lambda annot=
ations</p></div><p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p><div><p class=
=3D"MsoNormal">I don't think that those annotations should change the actua=
l symbol generated, because that would mean that you could break the ABI by=
 simply changing the name of the lambda, and conflicts can happen quite qui=
ckly. I would rather see those names used as informal lambda name for debug=
ging and error reporting messages.</p><div><p class=3D"MsoNormal"><o:p>&nbs=
p;</o:p></p></div><div><p class=3D"MsoNormal">Also, this was just an idea. =
Currently there is no way to do that, so it's just normal that in your case=
 they don't do anything.</p></div></div><div><p class=3D"MsoNormal"><o:p>&n=
bsp;</o:p></p><div><p class=3D"MsoNormal">On Sun, Apr 15, 2018 at 6:14 PM, =
Ritwik Das &lt;<a href=3D"mailto:ritwik.sami1990@gmail.com" target=3D"_blan=
k">ritwik.sami1990@gmail.com</a>&gt; wrote:</p><blockquote style=3D"border:=
none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:=
4.8pt;margin-right:0in"><div><div><p class=3D"MsoNormal" style=3D"mso-margi=
n-top-alt:auto;mso-margin-bottom-alt:auto">Standard attributes/implementati=
on specific attributes do not help much in this case but new attributes do =
not affect the compiler generated names I would want symbols to be generate=
d based on the given names. I tried something like this but the names are r=
andom regardless. What am I missing?</p><p class=3D"MsoNormal" style=3D"mso=
-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><div><div><div><=
p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-al=
t:auto"><span style=3D"color:blue">#include</span><span style=3D"color:blac=
k"> &lt;iostream&gt;</span></p></div><p class=3D"MsoNormal" style=3D"mso-ma=
rgin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><div><p class=3D"Ms=
oNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span=
 style=3D"color:blue">template</span><span style=3D"color:black">&lt;</span=
><span style=3D"color:blue">typename</span><span style=3D"color:black"> T&g=
t;</span></p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:=
auto;mso-margin-bottom-alt:auto"><span style=3D"color:blue">void</span><spa=
n style=3D"color:black"> func(T&amp;&amp; lambda)</span></p></div><div><p c=
lass=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:a=
uto"><span style=3D"color:black">{</span></p></div><div><p class=3D"MsoNorm=
al" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span styl=
e=3D"color:black">&nbsp;&nbsp;&nbsp;&nbsp;lambda();</span></p></div><div><p=
 class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto"><span style=3D"color:black">}</span></p></div><p class=3D"MsoNormal"=
 style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><di=
v><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom=
-alt:auto"><span style=3D"color:blue">int</span><span style=3D"color:black"=
> main()</span></p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-to=
p-alt:auto;mso-margin-bottom-alt:auto"><span style=3D"color:black">{</span>=
</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-=
margin-bottom-alt:auto"><span style=3D"color:black">&nbsp;&nbsp;&nbsp;&nbsp=
;func([]()</span><span style=3D"color:gray">[[cats::meow]]</span><span styl=
e=3D"color:black"> {std::cout &lt;&lt; </span><span style=3D"color:#A31515"=
>"Hello!"</span><span style=3D"color:black">; });</span></p></div><div><p c=
lass=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:a=
uto"><span style=3D"color:black">&nbsp;&nbsp;&nbsp;&nbsp;func([]() {std::co=
ut &lt;&lt; </span><span style=3D"color:#A31515">"world!"</span><span style=
=3D"color:black">; });</span></p></div><div><p class=3D"MsoNormal" style=3D=
"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style=3D"color:b=
lack">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style=3D"color:blue">return</spa=
n><span style=3D"color:black"> </span><span style=3D"color:#09885A">0</span=
><span style=3D"color:black">;</span></p></div><div><p class=3D"MsoNormal" =
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style=3D=
"color:black">}</span></p></div><p class=3D"MsoNormal" style=3D"mso-margin-=
top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div></div><p class=3D"=
MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nb=
sp;</p><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-b=
ottom-alt:auto">&nbsp;</p><p class=3D"MsoNormal" style=3D"mso-margin-top-al=
t:auto;mso-margin-bottom-alt:auto">Sent from <a href=3D"https://go.microsof=
t.com/fwlink/?LinkId=3D550986" target=3D"_blank">Mail</a> for Windows 10</p=
><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-=
alt:auto">&nbsp;</p><div style=3D"border:none;border-top:solid #E1E1E1 1.0p=
t;padding:3.0pt 0in 0in 0in"><p class=3D"MsoNormal" style=3D"mso-margin-top=
-alt:auto;mso-margin-bottom-alt:auto"><b>From: </b><a href=3D"mailto:blitzr=
akete@gmail.com" target=3D"_blank">Nicolas Lesser</a><br><b>Sent: </b>Sunda=
y, April 15, 2018 8:50 AM</p><div><div><p class=3D"MsoNormal"><br><b>To: </=
b><a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-proposa=
ls@isocpp.org</a><br><b>Subject: </b>Re: [std-proposals] Lambda annotations=
</p></div></div></div><div><div><p class=3D"MsoNormal" style=3D"mso-margin-=
top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><div><p class=3D"MsoNorm=
al" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Well, you =
could use either a new attribute or an implementation-defined attribute to =
give the lambda a name for debugging/error reporting purposes.</p></div><di=
v><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom=
-alt:auto">&nbsp;</p><div><p class=3D"MsoNormal" style=3D"mso-margin-top-al=
t:auto;mso-margin-bottom-alt:auto">On Sun, Apr 15, 2018 at 5:28 PM, Ritwik =
Das &lt;<a href=3D"mailto:ritwik.sami1990@gmail.com" target=3D"_blank">ritw=
ik.sami1990@gmail.com</a>&gt; wrote:</p><blockquote style=3D"border:none;bo=
rder-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;m=
argin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt"><div><div><p class=3D=
"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Bu=
t I am still confused how attributes can solve the problems mentioned below=
?</p><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bot=
tom-alt:auto">&nbsp;</p><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:=
auto;mso-margin-bottom-alt:auto">Sent from <a href=3D"https://go.microsoft.=
com/fwlink/?LinkId=3D550986" target=3D"_blank">Mail</a> for Windows 10</p><=
p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-al=
t:auto">&nbsp;</p><div style=3D"border:none;border-top:solid #E1E1E1 1.0pt;=
padding:3.0pt 0in 0in 0in"><p class=3D"MsoNormal" style=3D"mso-margin-top-a=
lt:auto;mso-margin-bottom-alt:auto"><b>From: </b><a href=3D"mailto:blitzrak=
ete@gmail.com" target=3D"_blank">Nicolas Lesser</a><br><b>Sent: </b>Sunday,=
 April 15, 2018 1:03 AM<br><b>To: </b><a href=3D"mailto:std-proposals@isocp=
p.org" target=3D"_blank">std-proposals@isocpp.org</a><br><b>Subject: </b>Re=
: [std-proposals] Lambda annotations</p></div><div><div><p class=3D"MsoNorm=
al" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p>=
<div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bot=
tom-alt:auto">There was a proposal or idea once to name lambdas to be able =
to name the lambda inside the lambda, and the syntax exactly matches what y=
ou propose.</p><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto=
;mso-margin-bottom-alt:auto">&nbsp;</p></div><div><p class=3D"MsoNormal" st=
yle=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Currently you ca=
n use an attribute :).</p></div></div><div><p class=3D"MsoNormal" style=3D"=
mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><div><p class=
=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"=
>On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das &lt;<a href=3D"mailto:ritwik.s=
ami1990@gmail.com" target=3D"_blank">ritwik.sami1990@gmail.com</a>&gt; wrot=
e:</p><blockquote style=3D"border:none;border-left:solid #CCCCCC 1.0pt;padd=
ing:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;m=
argin-bottom:5.0pt"><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt=
:auto;mso-margin-bottom-alt:auto"><span style=3D"font-size:13.5pt">Problem:=
</span></p><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso=
-margin-bottom-alt:auto">The fact that lambda functions are by design unnam=
ed means that the compiler has to assign names which show up in the call st=
ack while debugging and also in dumps etc. This makes things especially dif=
ficult for automated tools which categorize dumps based on the call stack b=
ecause the compiler assigned lambda names tend to change over time. Some sp=
ecific problems which occur because of the compiler assigning random names =
to lambda functions are cited below:</p></div><div><p class=3D"MsoNormal" s=
tyle=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div=
><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bo=
ttom-alt:auto"><b>Example 1:</b></p></div><div><p class=3D"MsoNormal" style=
=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><u>Sample code:</u>=
</p></div><div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto=
;mso-margin-bottom-alt:auto">template&lt;typename T&gt;</p></div><div><p cl=
ass=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:au=
to">int func(T&amp;&amp; lambda)</p></div><div><p class=3D"MsoNormal" style=
=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">{</p></div><div><p =
class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:=
auto">lambda();</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-to=
p-alt:auto;mso-margin-bottom-alt:auto">}</p></div><div><p class=3D"MsoNorma=
l" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><=
/div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margi=
n-bottom-alt:auto">int main()</p></div><div><p class=3D"MsoNormal" style=3D=
"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">{</p></div><div><p cla=
ss=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:aut=
o">func([]() {std::cout &lt;&lt; "Hello!"; });</p></div><div><p class=3D"Ms=
oNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">retur=
n 0;</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;=
mso-margin-bottom-alt:auto">}</p></div></div><div><p class=3D"MsoNormal" st=
yle=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div>=
<div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bot=
tom-alt:auto"><u>Compiler Error:</u></p></div><div><div><p class=3D"MsoNorm=
al" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">1&gt;lambd=
a.cpp</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto=
;mso-margin-bottom-alt:auto">1&gt;\lambda.cpp(11): error C4716: 'func&lt;&l=
t;<b>lambda_4653923a58ae9d647caab6ef4f61a443</b>&gt; &gt;': must return a v=
alue</p></div></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt=
:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div><div><p class=3D"MsoNorma=
l" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Errors like=
 this are hard to track because the error message does not really identify =
the source of the problem.</p></div><div><p class=3D"MsoNormal" style=3D"ms=
o-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div><div><p c=
lass=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:a=
uto"><b>Example 2:</b></p></div><div><div><p class=3D"MsoNormal" style=3D"m=
so-margin-top-alt:auto;mso-margin-bottom-alt:auto">&gt; ClassA::frame6 C++<=
/p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-m=
argin-bottom-alt:auto">&nbsp; ClassA::frame4::<b>__l62::&lt;lambda&gt;</b> =
C++</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;m=
so-margin-bottom-alt:auto">&nbsp; ClassB::frame3&lt;lambda&gt;(void) &gt; C=
++</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;ms=
o-margin-bottom-alt:auto">&nbsp; ClassA::frame2 C++</p></div><div><p class=
=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"=
>&nbsp; ClassA::frame1 C++</p></div></div><div><p class=3D"MsoNormal" style=
=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div><di=
v><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom=
-alt:auto">In the above call stack, the lambda function is referred to as "=
__l62" which neither is very useful nor does this stay invariant over time =
as more lambdas are added to the codebase (it is not even clear how this na=
me is chosen by the compiler).</p></div><div><p class=3D"MsoNormal" style=
=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div><di=
v><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom=
-alt:auto"><span style=3D"font-size:13.5pt">Proposal:</span></p></div><div>=
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">If there is a way for optionally annotating lambda functions with =
the declaration, the compiler can use this to produce lambda names more con=
sistently. e.g. The strawman syntax can be something like: "[=3D] <b>mylamb=
da1</b>() {...}". This might seem counter-intuitive since lambdas are defin=
ed to be <i>anonymous</i> functions, adding an optional annotation to the l=
ambda does not really take away the benefits of using lambdas over function=
s but rather makes it more powerful.</p></div><div><p class=3D"MsoNormal" s=
tyle=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div=
><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bo=
ttom-alt:auto">P.S.:</p></div><div><p class=3D"MsoNormal" style=3D"mso-marg=
in-top-alt:auto;mso-margin-bottom-alt:auto">Apologies if I missed proposals=
 which addresses the above problem.</p></div></div><p class=3D"MsoNormal" s=
tyle=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class=3D"=
m6031191767155126304m4195605197699100460hoenzb"><span style=3D"color:#88888=
8">-- </span></span><span style=3D"color:#888888"><br><span class=3D"m60311=
91767155126304m4195605197699100460hoenzb">You received this message because=
 you are subscribed to the Google Groups "ISO C++ Standard - Future Proposa=
ls" group.</span><br><span class=3D"m6031191767155126304m419560519769910046=
0hoenzb">To unsubscribe from this group and stop receiving emails from it, =
send an email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" ta=
rget=3D"_blank">std-proposals+unsubscribe@isocpp.org</a>.</span><br><span c=
lass=3D"m6031191767155126304m4195605197699100460hoenzb">To post to this gro=
up, send email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_bl=
ank">std-proposals@isocpp.org</a>.</span><br><span class=3D"m60311917671551=
26304m4195605197699100460hoenzb">To view this discussion on the web visit <=
a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5225=
897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=3Demail&amp;utm_so=
urce=3Dfooter" target=3D"_blank">https://groups.google.com/a/isocpp.org/d/m=
sgid/std-proposals/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org</a>.</=
span></span></p></blockquote></div><p class=3D"MsoNormal" style=3D"mso-marg=
in-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div></div></div><di=
v><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-b=
ottom-alt:auto">-- <br>You received this message because you are subscribed=
 to the Google Groups "ISO C++ Standard - Future Proposals" group.<br>To un=
subscribe from this group and stop receiving emails from it, send an email =
to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank=
">std-proposals+unsubscribe@isocpp.org</a>.<br>To post to this group, send =
email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-=
proposals@isocpp.org</a>.</p></div></div><p class=3D"MsoNormal" style=3D"ms=
o-margin-top-alt:auto;mso-margin-bottom-alt:auto">To view this discussion o=
n the web visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/s=
td-proposals/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail=
..gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">ht=
tps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq2sdDK05--=
85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com</a>.</p><p class=
=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"=
>&nbsp;</p></div></div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:a=
uto;mso-margin-bottom-alt:auto">-- <br>You received this message because yo=
u are subscribed to the Google Groups "ISO C++ Standard - Future Proposals"=
 group.<br>To unsubscribe from this group and stop receiving emails from it=
, send an email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" =
target=3D"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>To post to t=
his group, send email to <a href=3D"mailto:std-proposals@isocpp.org" target=
=3D"_blank">std-proposals@isocpp.org</a>.<br>To view this discussion on the=
 web visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-pr=
oposals/5ad36f81.c614620a.ddf08.2250%40mx.google.com?utm_medium=3Demail&amp=
;utm_source=3Dfooter" target=3D"_blank">https://groups.google.com/a/isocpp.=
org/d/msgid/std-proposals/5ad36f81.c614620a.ddf08.2250%40mx.google.com</a>.=
</p></blockquote></div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:a=
uto;mso-margin-bottom-alt:auto">&nbsp;</p></div></div></div><div><div><p cl=
ass=3D"MsoNormal">-- <br>You received this message because you are subscrib=
ed to the Google Groups "ISO C++ Standard - Future Proposals" group.<br>To =
unsubscribe from this group and stop receiving emails from it, send an emai=
l to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_bla=
nk">std-proposals+unsubscribe@isocpp.org</a>.<br>To post to this group, sen=
d email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">st=
d-proposals@isocpp.org</a>.</p></div></div><p class=3D"MsoNormal">To view t=
his discussion on the web visit <a href=3D"https://groups.google.com/a/isoc=
pp.org/d/msgid/std-proposals/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2=
ByLiz1oJg%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" targ=
et=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/=
CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com</a=
>.</p><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bo=
ttom-alt:auto">&nbsp;</p></div></div><p class=3D"MsoNormal">-- <br>You rece=
ived this message because you are subscribed to the Google Groups "ISO C++ =
Standard - Future Proposals" group.<br>To unsubscribe from this group and s=
top receiving emails from it, send an email to <a href=3D"mailto:std-propos=
als+unsubscribe@isocpp.org" target=3D"_blank">std-proposals+unsubscribe@iso=
cpp.org</a>.<br>To post to this group, send email to <a href=3D"mailto:std-=
proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>To=
 view this discussion on the web visit <a href=3D"https://groups.google.com=
/a/isocpp.org/d/msgid/std-proposals/5ad37a5f.d164650a.b857a.760b%40mx.googl=
e.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">https:/=
/groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad37a5f.d164650a.b85=
7a.760b%40mx.google.com</a>.</p></blockquote></div><p class=3D"MsoNormal"><=
o:p>&nbsp;</o:p></p></div><p class=3D"MsoNormal">-- <br>You received this m=
essage because you are subscribed to the Google Groups "ISO C++ Standard - =
Future Proposals" group.<br>To unsubscribe from this group and stop receivi=
ng emails from it, send an email to <a href=3D"mailto:std-proposals+unsubsc=
ribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br>To post to th=
is group, send email to <a href=3D"mailto:std-proposals@isocpp.org">std-pro=
posals@isocpp.org</a>.<br>To view this discussion on the web visit <a href=
=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq0tZ=
UjRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68%3DNQ%40mail.gmail.com?utm_medium=
=3Demail&amp;utm_source=3Dfooter">https://groups.google.com/a/isocpp.org/d/=
msgid/std-proposals/CALmDwq0tZUjRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68%3D=
NQ%40mail.gmail.com</a>.</p><p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p></d=
iv>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" 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/5ad38837.435a620a.8b39e.a4c7%40mx.goo=
gle.com?utm_medium=3Demail&amp;utm_source=3Dfooter">https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/5ad38837.435a620a.8b39e.a4c7%40mx.goo=
gle.com</a>.<br>
<br><!--end of _originalContent --></div></body></html>

<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/20180415172043.5099602.72847.50262%40=
gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com=
/a/isocpp.org/d/msgid/std-proposals/20180415172043.5099602.72847.50262%40gm=
ail.com</a>.<br />

.


Author: Tony V E <tvaneerd@gmail.com>
Date: Sun, 15 Apr 2018 13:22:01 -0400
Raw View
<html><head></head><body lang=3D"en-US" link=3D"blue" vlink=3D"#954F72" sty=
le=3D"background-color: rgb(255, 255, 255); line-height: initial;">        =
                                                                           =
   <div style=3D"width: 100%; font-size: initial; font-family: Calibri, 'Sl=
ate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: init=
ial; background-color: rgb(255, 255, 255);">That should have been:</div><di=
v style=3D"width: 100%; font-size: initial; font-family: Calibri, 'Slate Pr=
o', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; b=
ackground-color: rgb(255, 255, 255);"><br></div><div style=3D"width: 100%; =
font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-ser=
if; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255=
, 255, 255);">If you could name a lambda....</div>                         =
                                                                           =
                                 <div style=3D"width: 100%; font-size: init=
ial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(=
31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><=
br style=3D"display:initial"></div>                                        =
                                                                           =
                                                                           =
     <div style=3D"font-size: initial; font-family: Calibri, 'Slate Pro', s=
ans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; backgr=
ound-color: rgb(255, 255, 255);">Sent&nbsp;from&nbsp;my&nbsp;BlackBerry&nbs=
p;portable&nbsp;Babbage&nbsp;Device</div>                                  =
                                                                           =
                                                                     <table=
 width=3D"100%" style=3D"background-color:white;border-spacing:0px;"> <tbod=
y><tr><td colspan=3D"2" style=3D"font-size: initial; text-align: initial; b=
ackground-color: rgb(255, 255, 255);">                           <div style=
=3D"border-style: solid none none; border-top-color: rgb(181, 196, 223); bo=
rder-top-width: 1pt; padding: 3pt 0in 0in; font-family: Tahoma, 'BB Alpha S=
ans', 'Slate Pro'; font-size: 10pt;">  <div><b>From: </b>Tony V E</div><div=
><b>Sent: </b>Sunday, April 15, 2018 1:20 PM</div><div><b>To: </b>Ritwik Da=
s; std-proposals@isocpp.org</div><div><b>Subject: </b>Re: [std-proposals] L=
ambda annotations</div></div></td></tr></tbody></table><div style=3D"border=
-style: solid none none; border-top-color: rgb(186, 188, 209); border-top-w=
idth: 1pt; font-size: initial; text-align: initial; background-color: rgb(2=
55, 255, 255);"></div><br><div id=3D"_originalContent" style=3D"">         =
                                                                           =
  <div style=3D"width: 100%; font-size: initial; font-family: Calibri, 'Sla=
te Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initi=
al; background-color: rgb(255, 255, 255);">If you could name. Lambda, it wo=
uldn't change how the rest of the code is written (ie you wouldn't use the =
name to call the lambda) nor how the code works.&nbsp;</div><div style=3D"w=
idth: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-ser=
if, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-co=
lor: rgb(255, 255, 255);"><br></div><div style=3D"width: 100%; font-size: i=
nitial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: r=
gb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);=
">So from the standard's point of view, the name does nothing. It isn't rea=
lly =E2=80=8Epart of the language or the abstract machine.</div><div style=
=3D"width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', san=
s-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; backgrou=
nd-color: rgb(255, 255, 255);"><br></div><div style=3D"width: 100%; font-si=
ze: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; col=
or: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, =
255);">It would only affect debugging, etc. Which is beyond what the standa=
rd talks about.</div><div style=3D"width: 100%; font-size: initial; font-fa=
mily: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125)=
; text-align: initial; background-color: rgb(255, 255, 255);"><br></div><di=
v style=3D"width: 100%; font-size: initial; font-family: Calibri, 'Slate Pr=
o', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; b=
ackground-color: rgb(255, 255, 255);">So attributes would be the right tool=
 of choice here. They have the same properties.&nbsp;</div><div style=3D"wi=
dth: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-seri=
f, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-col=
or: rgb(255, 255, 255);"><br></div><div style=3D"width: 100%; font-size: in=
itial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rg=
b(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"=
>ie something like [[name:foo]]. Maybe we could also use the same attribute=
 for naming threads (which has been requested for the same reason: debuggin=
g) </div>                                                                  =
                                                                   <div sty=
le=3D"width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', s=
ans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; backgr=
ound-color: rgb(255, 255, 255);"><br style=3D"display:initial"></div>      =
                                                                           =
                                                                           =
                                       <div style=3D"font-size: initial; fo=
nt-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73,=
 125); text-align: initial; background-color: rgb(255, 255, 255);">Sent&nbs=
p;from&nbsp;my&nbsp;BlackBerry&nbsp;portable&nbsp;Babbage&nbsp;Device</div>=
                                                                           =
                                                                           =
                            <table width=3D"100%" style=3D"background-color=
:white;border-spacing:0px;"> <tbody><tr><td colspan=3D"2" style=3D"font-siz=
e: initial; text-align: initial; background-color: rgb(255, 255, 255);">   =
                        <div style=3D"border-style: solid none none; border=
-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0in 0in=
; font-family: Tahoma, 'BB Alpha Sans', 'Slate Pro'; font-size: 10pt;">  <d=
iv><b>From: </b>Ritwik Das</div><div><b>Sent: </b>Sunday, April 15, 2018 1:=
13 PM</div><div><b>To: </b>std-proposals@isocpp.org</div><div><b>Reply To: =
</b>std-proposals@isocpp.org</div><div><b>Subject: </b>RE: [std-proposals] =
Lambda annotations</div></div></td></tr></tbody></table><div style=3D"borde=
r-style: solid none none; border-top-color: rgb(186, 188, 209); border-top-=
width: 1pt; font-size: initial; text-align: initial; background-color: rgb(=
255, 255, 255);"></div><br><div id=3D"_originalContent" style=3D""><meta ht=
tp-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8"><meta name=
=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
 {font-family:"Cambria Math";
 panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
 {font-family:Calibri;
 panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
 {margin:0in;
 margin-bottom:.0001pt;
 font-size:11.0pt;
 font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
 {mso-style-priority:99;
 color:blue;
 text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
 {mso-style-priority:99;
 color:#954F72;
 text-decoration:underline;}
span.m6031191767155126304m4195605197699100460hoenzb
 {mso-style-name:m_6031191767155126304m4195605197699100460hoenzb;}
..MsoChpDefault
 {mso-style-type:export-only;}
@page WordSection1
 {size:8.5in 11.0in;
 margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
 {page:WordSection1;}
--></style><div class=3D"WordSection1"><p class=3D"MsoNormal">Isn=E2=80=99t=
 that the same behavior when someone changes regular function names, symbol=
s for which depend on the given names based on some predefined mangling rul=
es. I don=E2=80=99t want this to be any different for lambdas and that is w=
hat this proposal is about=E2=80=A6</p><p class=3D"MsoNormal"><o:p>&nbsp;</=
o:p></p><p class=3D"MsoNormal">Sent from <a href=3D"https://go.microsoft.co=
m/fwlink/?LinkId=3D550986">Mail</a> for Windows 10</p><p class=3D"MsoNormal=
"><o:p>&nbsp;</o:p></p><div style=3D"mso-element:para-border-div;border:non=
e;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in"><p class=3D"Mso=
Normal" style=3D"border:none;padding:0in"><b>From: </b><a href=3D"mailto:bl=
itzrakete@gmail.com">Nicolas Lesser</a><br><b>Sent: </b>Sunday, April 15, 2=
018 9:19 AM<br><b>To: </b><a href=3D"mailto:std-proposals@isocpp.org">std-p=
roposals@isocpp.org</a><br><b>Subject: </b>Re: [std-proposals] Lambda annot=
ations</p></div><p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p><div><p class=
=3D"MsoNormal">I don't think that those annotations should change the actua=
l symbol generated, because that would mean that you could break the ABI by=
 simply changing the name of the lambda, and conflicts can happen quite qui=
ckly. I would rather see those names used as informal lambda name for debug=
ging and error reporting messages.</p><div><p class=3D"MsoNormal"><o:p>&nbs=
p;</o:p></p></div><div><p class=3D"MsoNormal">Also, this was just an idea. =
Currently there is no way to do that, so it's just normal that in your case=
 they don't do anything.</p></div></div><div><p class=3D"MsoNormal"><o:p>&n=
bsp;</o:p></p><div><p class=3D"MsoNormal">On Sun, Apr 15, 2018 at 6:14 PM, =
Ritwik Das &lt;<a href=3D"mailto:ritwik.sami1990@gmail.com" target=3D"_blan=
k">ritwik.sami1990@gmail.com</a>&gt; wrote:</p><blockquote style=3D"border:=
none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:=
4.8pt;margin-right:0in"><div><div><p class=3D"MsoNormal" style=3D"mso-margi=
n-top-alt:auto;mso-margin-bottom-alt:auto">Standard attributes/implementati=
on specific attributes do not help much in this case but new attributes do =
not affect the compiler generated names I would want symbols to be generate=
d based on the given names. I tried something like this but the names are r=
andom regardless. What am I missing?</p><p class=3D"MsoNormal" style=3D"mso=
-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><div><div><div><=
p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-al=
t:auto"><span style=3D"color:blue">#include</span><span style=3D"color:blac=
k"> &lt;iostream&gt;</span></p></div><p class=3D"MsoNormal" style=3D"mso-ma=
rgin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><div><p class=3D"Ms=
oNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span=
 style=3D"color:blue">template</span><span style=3D"color:black">&lt;</span=
><span style=3D"color:blue">typename</span><span style=3D"color:black"> T&g=
t;</span></p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:=
auto;mso-margin-bottom-alt:auto"><span style=3D"color:blue">void</span><spa=
n style=3D"color:black"> func(T&amp;&amp; lambda)</span></p></div><div><p c=
lass=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:a=
uto"><span style=3D"color:black">{</span></p></div><div><p class=3D"MsoNorm=
al" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span styl=
e=3D"color:black">&nbsp;&nbsp;&nbsp;&nbsp;lambda();</span></p></div><div><p=
 class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto"><span style=3D"color:black">}</span></p></div><p class=3D"MsoNormal"=
 style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><di=
v><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom=
-alt:auto"><span style=3D"color:blue">int</span><span style=3D"color:black"=
> main()</span></p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-to=
p-alt:auto;mso-margin-bottom-alt:auto"><span style=3D"color:black">{</span>=
</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-=
margin-bottom-alt:auto"><span style=3D"color:black">&nbsp;&nbsp;&nbsp;&nbsp=
;func([]()</span><span style=3D"color:gray">[[cats::meow]]</span><span styl=
e=3D"color:black"> {std::cout &lt;&lt; </span><span style=3D"color:#A31515"=
>"Hello!"</span><span style=3D"color:black">; });</span></p></div><div><p c=
lass=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:a=
uto"><span style=3D"color:black">&nbsp;&nbsp;&nbsp;&nbsp;func([]() {std::co=
ut &lt;&lt; </span><span style=3D"color:#A31515">"world!"</span><span style=
=3D"color:black">; });</span></p></div><div><p class=3D"MsoNormal" style=3D=
"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style=3D"color:b=
lack">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style=3D"color:blue">return</spa=
n><span style=3D"color:black"> </span><span style=3D"color:#09885A">0</span=
><span style=3D"color:black">;</span></p></div><div><p class=3D"MsoNormal" =
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style=3D=
"color:black">}</span></p></div><p class=3D"MsoNormal" style=3D"mso-margin-=
top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div></div><p class=3D"=
MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nb=
sp;</p><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-b=
ottom-alt:auto">&nbsp;</p><p class=3D"MsoNormal" style=3D"mso-margin-top-al=
t:auto;mso-margin-bottom-alt:auto">Sent from <a href=3D"https://go.microsof=
t.com/fwlink/?LinkId=3D550986" target=3D"_blank">Mail</a> for Windows 10</p=
><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-=
alt:auto">&nbsp;</p><div style=3D"border:none;border-top:solid #E1E1E1 1.0p=
t;padding:3.0pt 0in 0in 0in"><p class=3D"MsoNormal" style=3D"mso-margin-top=
-alt:auto;mso-margin-bottom-alt:auto"><b>From: </b><a href=3D"mailto:blitzr=
akete@gmail.com" target=3D"_blank">Nicolas Lesser</a><br><b>Sent: </b>Sunda=
y, April 15, 2018 8:50 AM</p><div><div><p class=3D"MsoNormal"><br><b>To: </=
b><a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-proposa=
ls@isocpp.org</a><br><b>Subject: </b>Re: [std-proposals] Lambda annotations=
</p></div></div></div><div><div><p class=3D"MsoNormal" style=3D"mso-margin-=
top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><div><p class=3D"MsoNorm=
al" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Well, you =
could use either a new attribute or an implementation-defined attribute to =
give the lambda a name for debugging/error reporting purposes.</p></div><di=
v><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom=
-alt:auto">&nbsp;</p><div><p class=3D"MsoNormal" style=3D"mso-margin-top-al=
t:auto;mso-margin-bottom-alt:auto">On Sun, Apr 15, 2018 at 5:28 PM, Ritwik =
Das &lt;<a href=3D"mailto:ritwik.sami1990@gmail.com" target=3D"_blank">ritw=
ik.sami1990@gmail.com</a>&gt; wrote:</p><blockquote style=3D"border:none;bo=
rder-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;m=
argin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt"><div><div><p class=3D=
"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Bu=
t I am still confused how attributes can solve the problems mentioned below=
?</p><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bot=
tom-alt:auto">&nbsp;</p><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:=
auto;mso-margin-bottom-alt:auto">Sent from <a href=3D"https://go.microsoft.=
com/fwlink/?LinkId=3D550986" target=3D"_blank">Mail</a> for Windows 10</p><=
p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-al=
t:auto">&nbsp;</p><div style=3D"border:none;border-top:solid #E1E1E1 1.0pt;=
padding:3.0pt 0in 0in 0in"><p class=3D"MsoNormal" style=3D"mso-margin-top-a=
lt:auto;mso-margin-bottom-alt:auto"><b>From: </b><a href=3D"mailto:blitzrak=
ete@gmail.com" target=3D"_blank">Nicolas Lesser</a><br><b>Sent: </b>Sunday,=
 April 15, 2018 1:03 AM<br><b>To: </b><a href=3D"mailto:std-proposals@isocp=
p.org" target=3D"_blank">std-proposals@isocpp.org</a><br><b>Subject: </b>Re=
: [std-proposals] Lambda annotations</p></div><div><div><p class=3D"MsoNorm=
al" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p>=
<div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bot=
tom-alt:auto">There was a proposal or idea once to name lambdas to be able =
to name the lambda inside the lambda, and the syntax exactly matches what y=
ou propose.</p><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto=
;mso-margin-bottom-alt:auto">&nbsp;</p></div><div><p class=3D"MsoNormal" st=
yle=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Currently you ca=
n use an attribute :).</p></div></div><div><p class=3D"MsoNormal" style=3D"=
mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><div><p class=
=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"=
>On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das &lt;<a href=3D"mailto:ritwik.s=
ami1990@gmail.com" target=3D"_blank">ritwik.sami1990@gmail.com</a>&gt; wrot=
e:</p><blockquote style=3D"border:none;border-left:solid #CCCCCC 1.0pt;padd=
ing:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;m=
argin-bottom:5.0pt"><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt=
:auto;mso-margin-bottom-alt:auto"><span style=3D"font-size:13.5pt">Problem:=
</span></p><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso=
-margin-bottom-alt:auto">The fact that lambda functions are by design unnam=
ed means that the compiler has to assign names which show up in the call st=
ack while debugging and also in dumps etc. This makes things especially dif=
ficult for automated tools which categorize dumps based on the call stack b=
ecause the compiler assigned lambda names tend to change over time. Some sp=
ecific problems which occur because of the compiler assigning random names =
to lambda functions are cited below:</p></div><div><p class=3D"MsoNormal" s=
tyle=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div=
><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bo=
ttom-alt:auto"><b>Example 1:</b></p></div><div><p class=3D"MsoNormal" style=
=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><u>Sample code:</u>=
</p></div><div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto=
;mso-margin-bottom-alt:auto">template&lt;typename T&gt;</p></div><div><p cl=
ass=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:au=
to">int func(T&amp;&amp; lambda)</p></div><div><p class=3D"MsoNormal" style=
=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">{</p></div><div><p =
class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:=
auto">lambda();</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-to=
p-alt:auto;mso-margin-bottom-alt:auto">}</p></div><div><p class=3D"MsoNorma=
l" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><=
/div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margi=
n-bottom-alt:auto">int main()</p></div><div><p class=3D"MsoNormal" style=3D=
"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">{</p></div><div><p cla=
ss=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:aut=
o">func([]() {std::cout &lt;&lt; "Hello!"; });</p></div><div><p class=3D"Ms=
oNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">retur=
n 0;</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;=
mso-margin-bottom-alt:auto">}</p></div></div><div><p class=3D"MsoNormal" st=
yle=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div>=
<div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bot=
tom-alt:auto"><u>Compiler Error:</u></p></div><div><div><p class=3D"MsoNorm=
al" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">1&gt;lambd=
a.cpp</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto=
;mso-margin-bottom-alt:auto">1&gt;\lambda.cpp(11): error C4716: 'func&lt;&l=
t;<b>lambda_4653923a58ae9d647caab6ef4f61a443</b>&gt; &gt;': must return a v=
alue</p></div></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt=
:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div><div><p class=3D"MsoNorma=
l" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Errors like=
 this are hard to track because the error message does not really identify =
the source of the problem.</p></div><div><p class=3D"MsoNormal" style=3D"ms=
o-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div><div><p c=
lass=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:a=
uto"><b>Example 2:</b></p></div><div><div><p class=3D"MsoNormal" style=3D"m=
so-margin-top-alt:auto;mso-margin-bottom-alt:auto">&gt; ClassA::frame6 C++<=
/p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-m=
argin-bottom-alt:auto">&nbsp; ClassA::frame4::<b>__l62::&lt;lambda&gt;</b> =
C++</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;m=
so-margin-bottom-alt:auto">&nbsp; ClassB::frame3&lt;lambda&gt;(void) &gt; C=
++</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;ms=
o-margin-bottom-alt:auto">&nbsp; ClassA::frame2 C++</p></div><div><p class=
=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"=
>&nbsp; ClassA::frame1 C++</p></div></div><div><p class=3D"MsoNormal" style=
=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div><di=
v><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom=
-alt:auto">In the above call stack, the lambda function is referred to as "=
__l62" which neither is very useful nor does this stay invariant over time =
as more lambdas are added to the codebase (it is not even clear how this na=
me is chosen by the compiler).</p></div><div><p class=3D"MsoNormal" style=
=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div><di=
v><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom=
-alt:auto"><span style=3D"font-size:13.5pt">Proposal:</span></p></div><div>=
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto">If there is a way for optionally annotating lambda functions with =
the declaration, the compiler can use this to produce lambda names more con=
sistently. e.g. The strawman syntax can be something like: "[=3D] <b>mylamb=
da1</b>() {...}". This might seem counter-intuitive since lambdas are defin=
ed to be <i>anonymous</i> functions, adding an optional annotation to the l=
ambda does not really take away the benefits of using lambdas over function=
s but rather makes it more powerful.</p></div><div><p class=3D"MsoNormal" s=
tyle=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div=
><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bo=
ttom-alt:auto">P.S.:</p></div><div><p class=3D"MsoNormal" style=3D"mso-marg=
in-top-alt:auto;mso-margin-bottom-alt:auto">Apologies if I missed proposals=
 which addresses the above problem.</p></div></div><p class=3D"MsoNormal" s=
tyle=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class=3D"=
m6031191767155126304m4195605197699100460hoenzb"><span style=3D"color:#88888=
8">-- </span></span><span style=3D"color:#888888"><br><span class=3D"m60311=
91767155126304m4195605197699100460hoenzb">You received this message because=
 you are subscribed to the Google Groups "ISO C++ Standard - Future Proposa=
ls" group.</span><br><span class=3D"m6031191767155126304m419560519769910046=
0hoenzb">To unsubscribe from this group and stop receiving emails from it, =
send an email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" ta=
rget=3D"_blank">std-proposals+unsubscribe@isocpp.org</a>.</span><br><span c=
lass=3D"m6031191767155126304m4195605197699100460hoenzb">To post to this gro=
up, send email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_bl=
ank">std-proposals@isocpp.org</a>.</span><br><span class=3D"m60311917671551=
26304m4195605197699100460hoenzb">To view this discussion on the web visit <=
a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5225=
897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=3Demail&amp;utm_so=
urce=3Dfooter" target=3D"_blank">https://groups.google.com/a/isocpp.org/d/m=
sgid/std-proposals/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org</a>.</=
span></span></p></blockquote></div><p class=3D"MsoNormal" style=3D"mso-marg=
in-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div></div></div><di=
v><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-b=
ottom-alt:auto">-- <br>You received this message because you are subscribed=
 to the Google Groups "ISO C++ Standard - Future Proposals" group.<br>To un=
subscribe from this group and stop receiving emails from it, send an email =
to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank=
">std-proposals+unsubscribe@isocpp.org</a>.<br>To post to this group, send =
email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-=
proposals@isocpp.org</a>.</p></div></div><p class=3D"MsoNormal" style=3D"ms=
o-margin-top-alt:auto;mso-margin-bottom-alt:auto">To view this discussion o=
n the web visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/s=
td-proposals/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail=
..gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">ht=
tps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq2sdDK05--=
85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com</a>.</p><p class=
=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"=
>&nbsp;</p></div></div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:a=
uto;mso-margin-bottom-alt:auto">-- <br>You received this message because yo=
u are subscribed to the Google Groups "ISO C++ Standard - Future Proposals"=
 group.<br>To unsubscribe from this group and stop receiving emails from it=
, send an email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" =
target=3D"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>To post to t=
his group, send email to <a href=3D"mailto:std-proposals@isocpp.org" target=
=3D"_blank">std-proposals@isocpp.org</a>.<br>To view this discussion on the=
 web visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-pr=
oposals/5ad36f81.c614620a.ddf08.2250%40mx.google.com?utm_medium=3Demail&amp=
;utm_source=3Dfooter" target=3D"_blank">https://groups.google.com/a/isocpp.=
org/d/msgid/std-proposals/5ad36f81.c614620a.ddf08.2250%40mx.google.com</a>.=
</p></blockquote></div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:a=
uto;mso-margin-bottom-alt:auto">&nbsp;</p></div></div></div><div><div><p cl=
ass=3D"MsoNormal">-- <br>You received this message because you are subscrib=
ed to the Google Groups "ISO C++ Standard - Future Proposals" group.<br>To =
unsubscribe from this group and stop receiving emails from it, send an emai=
l to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_bla=
nk">std-proposals+unsubscribe@isocpp.org</a>.<br>To post to this group, sen=
d email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">st=
d-proposals@isocpp.org</a>.</p></div></div><p class=3D"MsoNormal">To view t=
his discussion on the web visit <a href=3D"https://groups.google.com/a/isoc=
pp.org/d/msgid/std-proposals/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2=
ByLiz1oJg%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" targ=
et=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/=
CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com</a=
>.</p><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bo=
ttom-alt:auto">&nbsp;</p></div></div><p class=3D"MsoNormal">-- <br>You rece=
ived this message because you are subscribed to the Google Groups "ISO C++ =
Standard - Future Proposals" group.<br>To unsubscribe from this group and s=
top receiving emails from it, send an email to <a href=3D"mailto:std-propos=
als+unsubscribe@isocpp.org" target=3D"_blank">std-proposals+unsubscribe@iso=
cpp.org</a>.<br>To post to this group, send email to <a href=3D"mailto:std-=
proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>To=
 view this discussion on the web visit <a href=3D"https://groups.google.com=
/a/isocpp.org/d/msgid/std-proposals/5ad37a5f.d164650a.b857a.760b%40mx.googl=
e.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">https:/=
/groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad37a5f.d164650a.b85=
7a.760b%40mx.google.com</a>.</p></blockquote></div><p class=3D"MsoNormal"><=
o:p>&nbsp;</o:p></p></div><p class=3D"MsoNormal">-- <br>You received this m=
essage because you are subscribed to the Google Groups "ISO C++ Standard - =
Future Proposals" group.<br>To unsubscribe from this group and stop receivi=
ng emails from it, send an email to <a href=3D"mailto:std-proposals+unsubsc=
ribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br>To post to th=
is group, send email to <a href=3D"mailto:std-proposals@isocpp.org">std-pro=
posals@isocpp.org</a>.<br>To view this discussion on the web visit <a href=
=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq0tZ=
UjRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68%3DNQ%40mail.gmail.com?utm_medium=
=3Demail&amp;utm_source=3Dfooter">https://groups.google.com/a/isocpp.org/d/=
msgid/std-proposals/CALmDwq0tZUjRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68%3D=
NQ%40mail.gmail.com</a>.</p><p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p></d=
iv>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" 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/5ad38837.435a620a.8b39e.a4c7%40mx.goo=
gle.com?utm_medium=3Demail&amp;utm_source=3Dfooter">https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/5ad38837.435a620a.8b39e.a4c7%40mx.goo=
gle.com</a>.<br>
<br><!--end of _originalContent --></div>
<br><!--end of _originalContent --></div></body></html>

<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/20180415172201.5099602.60688.50265%40=
gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com=
/a/isocpp.org/d/msgid/std-proposals/20180415172201.5099602.60688.50265%40gm=
ail.com</a>.<br />

.


Author: Patrice Roy <patricer@gmail.com>
Date: Sun, 15 Apr 2018 13:26:15 -0400
Raw View
--00000000000017252f0569e66744
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Sounds like a cool song title for geeks :)

2018-04-15 13:22 GMT-04:00 Tony V E <tvaneerd@gmail.com>:

> That should have been:
>
> If you could name a lambda....
>
> Sent from my BlackBerry portable Babbage Device
> *From: *Tony V E
> *Sent: *Sunday, April 15, 2018 1:20 PM
> *To: *Ritwik Das; std-proposals@isocpp.org
> *Subject: *Re: [std-proposals] Lambda annotations
>
> If you could name. Lambda, it wouldn't change how the rest of the code is
> written (ie you wouldn't use the name to call the lambda) nor how the cod=
e
> works.
>
> So from the standard's point of view, the name does nothing. It isn't
> really =E2=80=8Epart of the language or the abstract machine.
>
> It would only affect debugging, etc. Which is beyond what the standard
> talks about.
>
> So attributes would be the right tool of choice here. They have the same
> properties.
>
> ie something like [[name:foo]]. Maybe we could also use the same attribut=
e
> for naming threads (which has been requested for the same reason:
> debugging)
>
> Sent from my BlackBerry portable Babbage Device
> *From: *Ritwik Das
> *Sent: *Sunday, April 15, 2018 1:13 PM
> *To: *std-proposals@isocpp.org
> *Reply To: *std-proposals@isocpp.org
> *Subject: *RE: [std-proposals] Lambda annotations
>
> Isn=E2=80=99t that the same behavior when someone changes regular functio=
n names,
> symbols for which depend on the given names based on some predefined
> mangling rules. I don=E2=80=99t want this to be any different for lambdas=
 and that
> is what this proposal is about=E2=80=A6
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=3D550986> for
> Windows 10
>
>
>
> *From: *Nicolas Lesser <blitzrakete@gmail.com>
> *Sent: *Sunday, April 15, 2018 9:19 AM
> *To: *std-proposals@isocpp.org
> *Subject: *Re: [std-proposals] Lambda annotations
>
>
>
> I don't think that those annotations should change the actual symbol
> generated, because that would mean that you could break the ABI by simply
> changing the name of the lambda, and conflicts can happen quite quickly. =
I
> would rather see those names used as informal lambda name for debugging a=
nd
> error reporting messages.
>
>
>
> Also, this was just an idea. Currently there is no way to do that, so it'=
s
> just normal that in your case they don't do anything.
>
>
>
> On Sun, Apr 15, 2018 at 6:14 PM, Ritwik Das <ritwik.sami1990@gmail.com>
> wrote:
>
> Standard attributes/implementation specific attributes do not help much i=
n
> this case but new attributes do not affect the compiler generated names I
> would want symbols to be generated based on the given names. I tried
> something like this but the names are random regardless. What am I missin=
g?
>
>
>
> #include <iostream>
>
>
>
> template<typename T>
>
> void func(T&& lambda)
>
> {
>
>     lambda();
>
> }
>
>
>
> int main()
>
> {
>
>     func([]()[[cats::meow]] {std::cout << "Hello!"; });
>
>     func([]() {std::cout << "world!"; });
>
>     return 0;
>
> }
>
>
>
>
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=3D550986> for
> Windows 10
>
>
>
> *From: *Nicolas Lesser <blitzrakete@gmail.com>
> *Sent: *Sunday, April 15, 2018 8:50 AM
>
>
> *To: *std-proposals@isocpp.org
> *Subject: *Re: [std-proposals] Lambda annotations
>
>
>
> Well, you could use either a new attribute or an implementation-defined
> attribute to give the lambda a name for debugging/error reporting purpose=
s.
>
>
>
> On Sun, Apr 15, 2018 at 5:28 PM, Ritwik Das <ritwik.sami1990@gmail.com>
> wrote:
>
> But I am still confused how attributes can solve the problems mentioned
> below?
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=3D550986> for
> Windows 10
>
>
>
> *From: *Nicolas Lesser <blitzrakete@gmail.com>
> *Sent: *Sunday, April 15, 2018 1:03 AM
> *To: *std-proposals@isocpp.org
> *Subject: *Re: [std-proposals] Lambda annotations
>
>
>
> There was a proposal or idea once to name lambdas to be able to name the
> lambda inside the lambda, and the syntax exactly matches what you propose=
..
>
>
>
> Currently you can use an attribute :).
>
>
>
> On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das <ritwik.sami1990@gmail.com>
> wrote:
>
> Problem:
>
> The fact that lambda functions are by design unnamed means that the
> compiler has to assign names which show up in the call stack while
> debugging and also in dumps etc. This makes things especially difficult f=
or
> automated tools which categorize dumps based on the call stack because th=
e
> compiler assigned lambda names tend to change over time. Some specific
> problems which occur because of the compiler assigning random names to
> lambda functions are cited below:
>
>
>
> *Example 1:*
>
> *Sample code:*
>
> template<typename T>
>
> int func(T&& lambda)
>
> {
>
> lambda();
>
> }
>
>
>
> int main()
>
> {
>
> func([]() {std::cout << "Hello!"; });
>
> return 0;
>
> }
>
>
>
> *Compiler Error:*
>
> 1>lambda.cpp
>
> 1>\lambda.cpp(11): error C4716: 'func<<
> *lambda_4653923a58ae9d647caab6ef4f61a443*> >': must return a value
>
>
>
> Errors like this are hard to track because the error message does not
> really identify the source of the problem.
>
>
>
> *Example 2:*
>
> > ClassA::frame6 C++
>
>   ClassA::frame4::*__l62::<lambda>* C++
>
>   ClassB::frame3<lambda>(void) > C++
>
>   ClassA::frame2 C++
>
>   ClassA::frame1 C++
>
>
>
> In the above call stack, the lambda function is referred to as "__l62"
> which neither is very useful nor does this stay invariant over time as mo=
re
> lambdas are added to the codebase (it is not even clear how this name is
> chosen by the compiler).
>
>
>
> Proposal:
>
> If there is a way for optionally annotating lambda functions with the
> declaration, the compiler can use this to produce lambda names more
> consistently. e.g. The strawman syntax can be something like: "[=3D]
> *mylambda1*() {...}". This might seem counter-intuitive since lambdas are
> defined to be *anonymous* functions, adding an optional annotation to the
> lambda does not really take away the benefits of using lambdas over
> functions but rather makes it more powerful.
>
>
>
> P.S.:
>
> Apologies if I missed proposals which addresses the above problem.
>
> --
> 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/5225897d-fa81-4137-
> 928d-f97fcb4f2efe%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5225897d-fa=
81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>
>
>
> --
> 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/CALmDwq2sdDK05--
> 85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq2sdD=
K05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com?utm_medium=3D=
email&utm_source=3Dfooter>
> .
>
>
>
> --
> 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/5ad36f81.c614620a.
> ddf08.2250%40mx.google.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad36f81.c6=
14620a.ddf08.2250%40mx.google.com?utm_medium=3Demail&utm_source=3Dfooter>
> .
>
>
>
> --
> 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/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZ
> Z%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq1oGu=
P3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com?utm_medium=3D=
email&utm_source=3Dfooter>
> .
>
>
>
> --
> 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/5ad37a5f.d164650a.
> b857a.760b%40mx.google.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad37a5f.d1=
64650a.b857a.760b%40mx.google.com?utm_medium=3Demail&utm_source=3Dfooter>
> .
>
>
>
> --
> 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/CALmDwq0tZUjRMpD7i_pwKS_G2%2BgvwCH5T%
> 2BaJEypujVuEx68%3DNQ%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq0tZU=
jRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68%3DNQ%40mail.gmail.com?utm_medium=
=3Demail&utm_source=3Dfooter>
> .
>
>
>
> --
> 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/5ad38837.435a620a.
> 8b39e.a4c7%40mx.google.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad38837.43=
5a620a.8b39e.a4c7%40mx.google.com?utm_medium=3Demail&utm_source=3Dfooter>
> .
>
>
> --
> 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/20180415172201.
> 5099602.60688.50265%40gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/20180415172=
201.5099602.60688.50265%40gmail.com?utm_medium=3Demail&utm_source=3Dfooter>
> .
>

--=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/CAKiZDp09nHdGRvboiTe2OfhOE0J8JqutAhkoK3DU8cZeuiH=
qKQ%40mail.gmail.com.

--00000000000017252f0569e66744
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Sounds like a cool song title for geeks :)<br></div><div c=
lass=3D"gmail_extra"><br><div class=3D"gmail_quote">2018-04-15 13:22 GMT-04=
:00 Tony V E <span dir=3D"ltr">&lt;<a href=3D"mailto:tvaneerd@gmail.com" ta=
rget=3D"_blank">tvaneerd@gmail.com</a>&gt;</span>:<br><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex"><div link=3D"blue" vlink=3D"#954F72" style=3D"background-color:rg=
b(255,255,255);line-height:initial" lang=3D"en-US">                        =
                                                              <div style=3D=
"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-=
serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:r=
gb(255,255,255)">That should have been:</div><div style=3D"width:100%;font-=
size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;=
color:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)">=
<br></div><div style=3D"width:100%;font-size:initial;font-family:Calibri,&#=
39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:ini=
tial;background-color:rgb(255,255,255)">If you could name a lambda....</div=
><span class=3D"">                                                         =
                                                                           =
 <div style=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate =
Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;back=
ground-color:rgb(255,255,255)"><br style=3D"display:initial"></div>        =
                                                                           =
                                                                           =
                                     <div style=3D"font-size:initial;font-f=
amily:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125=
);text-align:initial;background-color:rgb(255,255,255)">Sent=C2=A0from=C2=
=A0my=C2=A0BlackBerry=C2=A0<wbr>portable=C2=A0Babbage=C2=A0Device</div>    =
                                                                           =
                                                                           =
                        </span><table style=3D"background-color:white;borde=
r-spacing:0px" width=3D"100%"> <tbody><tr><td colspan=3D"2" style=3D"font-s=
ize:initial;text-align:initial;background-color:rgb(255,255,255)">         =
                  <div style=3D"border-style:solid none none;border-top-col=
or:rgb(181,196,223);border-top-width:1pt;padding:3pt 0in 0in;font-family:Ta=
homa,&#39;BB Alpha Sans&#39;,&#39;Slate Pro&#39;;font-size:10pt">  <div><b>=
From: </b>Tony V E</div><div><b>Sent: </b>Sunday, April 15, 2018 1:20 PM</d=
iv><div><b>To: </b>Ritwik Das; <a href=3D"mailto:std-proposals@isocpp.org" =
target=3D"_blank">std-proposals@isocpp.org</a></div><div><div class=3D"h5">=
<div><b>Subject: </b>Re: [std-proposals] Lambda annotations</div></div></di=
v></div></td></tr></tbody></table><div><div class=3D"h5"><div style=3D"bord=
er-style:solid none none;border-top-color:rgb(186,188,209);border-top-width=
:1pt;font-size:initial;text-align:initial;background-color:rgb(255,255,255)=
"></div><br><div id=3D"m_3176913255906977344_originalContent">             =
                                                                         <d=
iv style=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro=
&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;backgro=
und-color:rgb(255,255,255)">If you could name. Lambda, it wouldn&#39;t chan=
ge how the rest of the code is written (ie you wouldn&#39;t use the name to=
 call the lambda) nor how the code works.=C2=A0</div><div style=3D"width:10=
0%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,san=
s-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,25=
5,255)"><br></div><div style=3D"width:100%;font-size:initial;font-family:Ca=
libri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-a=
lign:initial;background-color:rgb(255,255,255)">So from the standard&#39;s =
point of view, the name does nothing. It isn&#39;t really =E2=80=8Epart of =
the language or the abstract machine.</div><div style=3D"width:100%;font-si=
ze:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;co=
lor:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)"><b=
r></div><div style=3D"width:100%;font-size:initial;font-family:Calibri,&#39=
;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initi=
al;background-color:rgb(255,255,255)">It would only affect debugging, etc. =
Which is beyond what the standard talks about.</div><div style=3D"width:100=
%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans=
-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,255=
,255)"><br></div><div style=3D"width:100%;font-size:initial;font-family:Cal=
ibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-al=
ign:initial;background-color:rgb(255,255,255)">So attributes would be the r=
ight tool of choice here. They have the same properties.=C2=A0</div><div st=
yle=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;=
,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-c=
olor:rgb(255,255,255)"><br></div><div style=3D"width:100%;font-size:initial=
;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31=
,73,125);text-align:initial;background-color:rgb(255,255,255)">ie something=
 like [[name:foo]]. Maybe we could also use the same attribute for naming t=
hreads (which has been requested for the same reason: debugging) </div>    =
                                                                           =
                                                      <div style=3D"width:1=
00%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sa=
ns-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,2=
55,255)"><br style=3D"display:initial"></div>                              =
                                                                           =
                                                                           =
               <div style=3D"font-size:initial;font-family:Calibri,&#39;Sla=
te Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;b=
ackground-color:rgb(255,255,255)">Sent=C2=A0from=C2=A0my=C2=A0BlackBerry=C2=
=A0<wbr>portable=C2=A0Babbage=C2=A0Device</div>                            =
                                                                           =
                                                                           =
<table style=3D"background-color:white;border-spacing:0px" width=3D"100%"> =
<tbody><tr><td colspan=3D"2" style=3D"font-size:initial;text-align:initial;=
background-color:rgb(255,255,255)">                           <div style=3D=
"border-style:solid none none;border-top-color:rgb(181,196,223);border-top-=
width:1pt;padding:3pt 0in 0in;font-family:Tahoma,&#39;BB Alpha Sans&#39;,&#=
39;Slate Pro&#39;;font-size:10pt">  <div><b>From: </b>Ritwik Das</div><div>=
<b>Sent: </b>Sunday, April 15, 2018 1:13 PM</div><div><b>To: </b><a href=3D=
"mailto:std-proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.or=
g</a></div><div><b>Reply To: </b><a href=3D"mailto:std-proposals@isocpp.org=
" target=3D"_blank">std-proposals@isocpp.org</a></div><div><b>Subject: </b>=
RE: [std-proposals] Lambda annotations</div></div></td></tr></tbody></table=
><div style=3D"border-style:solid none none;border-top-color:rgb(186,188,20=
9);border-top-width:1pt;font-size:initial;text-align:initial;background-col=
or:rgb(255,255,255)"></div><br><div id=3D"m_3176913255906977344_originalCon=
tent"><div class=3D"m_3176913255906977344WordSection1"><p class=3D"MsoNorma=
l">Isn=E2=80=99t that the same behavior when someone changes regular functi=
on names, symbols for which depend on the given names based on some predefi=
ned mangling rules. I don=E2=80=99t want this to be any different for lambd=
as and that is what this proposal is about=E2=80=A6</p><p class=3D"MsoNorma=
l"><u></u>=C2=A0<u></u></p><p class=3D"MsoNormal">Sent from <a href=3D"http=
s://go.microsoft.com/fwlink/?LinkId=3D550986" target=3D"_blank">Mail</a> fo=
r Windows 10</p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><div style=
=3D"border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><=
p class=3D"MsoNormal" style=3D"border:none;padding:0in"><b>From: </b><a hre=
f=3D"mailto:blitzrakete@gmail.com" target=3D"_blank">Nicolas Lesser</a><br>=
<b>Sent: </b>Sunday, April 15, 2018 9:19 AM<br><b>To: </b><a href=3D"mailto=
:std-proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a><b=
r><b>Subject: </b>Re: [std-proposals] Lambda annotations</p></div><p class=
=3D"MsoNormal"><u></u>=C2=A0<u></u></p><div><p class=3D"MsoNormal">I don&#3=
9;t think that those annotations should change the actual symbol generated,=
 because that would mean that you could break the ABI by simply changing th=
e name of the lambda, and conflicts can happen quite quickly. I would rathe=
r see those names used as informal lambda name for debugging and error repo=
rting messages.</p><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></di=
v><div><p class=3D"MsoNormal">Also, this was just an idea. Currently there =
is no way to do that, so it&#39;s just normal that in your case they don&#3=
9;t do anything.</p></div></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u=
></u></p><div><p class=3D"MsoNormal">On Sun, Apr 15, 2018 at 6:14 PM, Ritwi=
k Das &lt;<a href=3D"mailto:ritwik.sami1990@gmail.com" target=3D"_blank">ri=
twik.sami1990@gmail.com</a>&gt; wrote:</p><blockquote style=3D"border:none;=
border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt=
;margin-right:0in"><div><div><p class=3D"MsoNormal">Standard attributes/imp=
lementation specific attributes do not help much in this case but new attri=
butes do not affect the compiler generated names I would want symbols to be=
 generated based on the given names. I tried something like this but the na=
mes are random regardless. What am I missing?</p><p class=3D"MsoNormal">=C2=
=A0</p><div><div><div><p class=3D"MsoNormal"><span style=3D"color:blue">#in=
clude</span><span style=3D"color:black"> &lt;iostream&gt;</span></p></div><=
p class=3D"MsoNormal">=C2=A0</p><div><p class=3D"MsoNormal"><span style=3D"=
color:blue">template</span><span style=3D"color:black">&lt;</span><span sty=
le=3D"color:blue">typename</span><span style=3D"color:black"> T&gt;</span><=
/p></div><div><p class=3D"MsoNormal"><span style=3D"color:blue">void</span>=
<span style=3D"color:black"> func(T&amp;&amp; lambda)</span></p></div><div>=
<p class=3D"MsoNormal"><span style=3D"color:black">{</span></p></div><div><=
p class=3D"MsoNormal"><span style=3D"color:black">=C2=A0=C2=A0=C2=A0=C2=A0l=
ambda();</span></p></div><div><p class=3D"MsoNormal"><span style=3D"color:b=
lack">}</span></p></div><p class=3D"MsoNormal">=C2=A0</p><div><p class=3D"M=
soNormal"><span style=3D"color:blue">int</span><span style=3D"color:black">=
 main()</span></p></div><div><p class=3D"MsoNormal"><span style=3D"color:bl=
ack">{</span></p></div><div><p class=3D"MsoNormal"><span style=3D"color:bla=
ck">=C2=A0=C2=A0=C2=A0=C2=A0func([]()</span><span style=3D"color:gray">[[ca=
ts::meow]]</span><span style=3D"color:black"> {std::cout &lt;&lt; </span><s=
pan style=3D"color:#a31515">&quot;Hello!&quot;</span><span style=3D"color:b=
lack">; });</span></p></div><div><p class=3D"MsoNormal"><span style=3D"colo=
r:black">=C2=A0=C2=A0=C2=A0=C2=A0func([]() {std::cout &lt;&lt; </span><span=
 style=3D"color:#a31515">&quot;world!&quot;</span><span style=3D"color:blac=
k">; });</span></p></div><div><p class=3D"MsoNormal"><span style=3D"color:b=
lack">=C2=A0=C2=A0=C2=A0=C2=A0</span><span style=3D"color:blue">return</spa=
n><span style=3D"color:black"> </span><span style=3D"color:#09885a">0</span=
><span style=3D"color:black">;</span></p></div><div><p class=3D"MsoNormal">=
<span style=3D"color:black">}</span></p></div><p class=3D"MsoNormal">=C2=A0=
</p></div></div><p class=3D"MsoNormal">=C2=A0</p><p class=3D"MsoNormal">=C2=
=A0</p><p class=3D"MsoNormal">Sent from <a href=3D"https://go.microsoft.com=
/fwlink/?LinkId=3D550986" target=3D"_blank">Mail</a> for Windows 10</p><p c=
lass=3D"MsoNormal">=C2=A0</p><div style=3D"border:none;border-top:solid #e1=
e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class=3D"MsoNormal"><b>From: </b><=
a href=3D"mailto:blitzrakete@gmail.com" target=3D"_blank">Nicolas Lesser</a=
><br><b>Sent: </b>Sunday, April 15, 2018 8:50 AM</p><div><div><p class=3D"M=
soNormal"><br><b>To: </b><a href=3D"mailto:std-proposals@isocpp.org" target=
=3D"_blank">std-proposals@isocpp.org</a><br><b>Subject: </b>Re: [std-propos=
als] Lambda annotations</p></div></div></div><div><div><p class=3D"MsoNorma=
l">=C2=A0</p><div><p class=3D"MsoNormal">Well, you could use either a new a=
ttribute or an implementation-defined attribute to give the lambda a name f=
or debugging/error reporting purposes.</p></div><div><p class=3D"MsoNormal"=
>=C2=A0</p><div><p class=3D"MsoNormal">On Sun, Apr 15, 2018 at 5:28 PM, Rit=
wik Das &lt;<a href=3D"mailto:ritwik.sami1990@gmail.com" target=3D"_blank">=
ritwik.sami1990@gmail.com</a>&gt; wrote:</p><blockquote style=3D"border:non=
e;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8=
pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt"><div><div><p clas=
s=3D"MsoNormal">But I am still confused how attributes can solve the proble=
ms mentioned below?</p><p class=3D"MsoNormal">=C2=A0</p><p class=3D"MsoNorm=
al">Sent from <a href=3D"https://go.microsoft.com/fwlink/?LinkId=3D550986" =
target=3D"_blank">Mail</a> for Windows 10</p><p class=3D"MsoNormal">=C2=A0<=
/p><div style=3D"border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0=
in 0in 0in"><p class=3D"MsoNormal"><b>From: </b><a href=3D"mailto:blitzrake=
te@gmail.com" target=3D"_blank">Nicolas Lesser</a><br><b>Sent: </b>Sunday, =
April 15, 2018 1:03 AM<br><b>To: </b><a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a><br><b>Subject: </b>Re:=
 [std-proposals] Lambda annotations</p></div><div><div><p class=3D"MsoNorma=
l">=C2=A0</p><div><p class=3D"MsoNormal">There was a proposal or idea once =
to name lambdas to be able to name the lambda inside the lambda, and the sy=
ntax exactly matches what you propose.</p><div><p class=3D"MsoNormal">=C2=
=A0</p></div><div><p class=3D"MsoNormal">Currently you can use an attribute=
 :).</p></div></div><div><p class=3D"MsoNormal">=C2=A0</p><div><p class=3D"=
MsoNormal">On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das &lt;<a href=3D"mailt=
o:ritwik.sami1990@gmail.com" target=3D"_blank">ritwik.sami1990@gmail.com</a=
>&gt; wrote:</p><blockquote style=3D"border:none;border-left:solid #cccccc =
1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-r=
ight:0in;margin-bottom:5.0pt"><div><p class=3D"MsoNormal"><span style=3D"fo=
nt-size:13.5pt">Problem:</span></p><div><p class=3D"MsoNormal">The fact tha=
t lambda functions are by design unnamed means that the compiler has to ass=
ign names which show up in the call stack while debugging and also in dumps=
 etc. This makes things especially difficult for automated tools which cate=
gorize dumps based on the call stack because the compiler assigned lambda n=
ames tend to change over time. Some specific problems which occur because o=
f the compiler assigning random names to lambda functions are cited below:<=
/p></div><div><p class=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNo=
rmal"><b>Example 1:</b></p></div><div><p class=3D"MsoNormal"><u>Sample code=
:</u></p></div><div><div><p class=3D"MsoNormal">template&lt;typename T&gt;<=
/p></div><div><p class=3D"MsoNormal">int func(T&amp;&amp; lambda)</p></div>=
<div><p class=3D"MsoNormal">{</p></div><div><p class=3D"MsoNormal">lambda()=
;</p></div><div><p class=3D"MsoNormal">}</p></div><div><p class=3D"MsoNorma=
l">=C2=A0</p></div><div><p class=3D"MsoNormal">int main()</p></div><div><p =
class=3D"MsoNormal">{</p></div><div><p class=3D"MsoNormal">func([]() {std::=
cout &lt;&lt; &quot;Hello!&quot;; });</p></div><div><p class=3D"MsoNormal">=
return 0;</p></div><div><p class=3D"MsoNormal">}</p></div></div><div><p cla=
ss=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNormal"><u>Compiler Er=
ror:</u></p></div><div><div><p class=3D"MsoNormal">1&gt;lambda.cpp</p></div=
><div><p class=3D"MsoNormal">1&gt;\lambda.cpp(11): error C4716: &#39;func&l=
t;&lt;<b>lambda_<wbr>4653923a58ae9d647caab6ef4f61a4<wbr>43</b>&gt; &gt;&#39=
;: must return a value</p></div></div><div><p class=3D"MsoNormal">=C2=A0</p=
></div><div><p class=3D"MsoNormal">Errors like this are hard to track becau=
se the error message does not really identify the source of the problem.</p=
></div><div><p class=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNorm=
al"><b>Example 2:</b></p></div><div><div><p class=3D"MsoNormal">&gt; ClassA=
::frame6 C++</p></div><div><p class=3D"MsoNormal">=C2=A0 ClassA::frame4::<b=
>__l62::&lt;<wbr>lambda&gt;</b> C++</p></div><div><p class=3D"MsoNormal">=
=C2=A0 ClassB::frame3&lt;lambda&gt;(void) &gt; C++</p></div><div><p class=
=3D"MsoNormal">=C2=A0 ClassA::frame2 C++</p></div><div><p class=3D"MsoNorma=
l">=C2=A0 ClassA::frame1 C++</p></div></div><div><p class=3D"MsoNormal">=C2=
=A0</p></div><div><p class=3D"MsoNormal">In the above call stack, the lambd=
a function is referred to as &quot;__l62&quot; which neither is very useful=
 nor does this stay invariant over time as more lambdas are added to the co=
debase (it is not even clear how this name is chosen by the compiler).</p><=
/div><div><p class=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNormal=
"><span style=3D"font-size:13.5pt">Proposal:</span></p></div><div><p class=
=3D"MsoNormal">If there is a way for optionally annotating lambda functions=
 with the declaration, the compiler can use this to produce lambda names mo=
re consistently. e.g. The strawman syntax can be something like: &quot;[=3D=
] <b>mylambda1</b>() {...}&quot;. This might seem counter-intuitive since l=
ambdas are defined to be <i>anonymous</i> functions, adding an optional ann=
otation to the lambda does not really take away the benefits of using lambd=
as over functions but rather makes it more powerful.</p></div><div><p class=
=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNormal">P.S.:</p></div><=
div><p class=3D"MsoNormal">Apologies if I missed proposals which addresses =
the above problem.</p></div></div><p class=3D"MsoNormal"><span class=3D"m_3=
176913255906977344m6031191767155126304m4195605197699100460hoenzb"><span sty=
le=3D"color:#888888">-- </span></span><span style=3D"color:#888888"><br><sp=
an class=3D"m_3176913255906977344m6031191767155126304m4195605197699100460ho=
enzb">You received this message because you are subscribed to the Google Gr=
oups &quot;ISO C++ Standard - Future Proposals&quot; group.</span><br><span=
 class=3D"m_3176913255906977344m6031191767155126304m4195605197699100460hoen=
zb">To unsubscribe from this group and stop receiving emails from it, send =
an email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=
=3D"_blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.</span><br><span =
class=3D"m_3176913255906977344m6031191767155126304m4195605197699100460hoenz=
b">To post to this group, send email to <a href=3D"mailto:std-proposals@iso=
cpp.org" target=3D"_blank">std-proposals@isocpp.org</a>.</span><br><span cl=
ass=3D"m_3176913255906977344m6031191767155126304m4195605197699100460hoenzb"=
>To view this discussion on the web visit <a href=3D"https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/5225897d-fa81-4137-928d-f97fcb4f2efe=
%40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank"=
>https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/522=
5897d-fa81-4137-<wbr>928d-f97fcb4f2efe%40isocpp.org</a><wbr>.</span></span>=
</p></blockquote></div><p class=3D"MsoNormal">=C2=A0</p></div></div></div><=
div><div><p class=3D"MsoNormal">-- <br>You received this message because yo=
u are subscribed to the Google Groups &quot;ISO C++ Standard - Future Propo=
sals&quot; group.<br>To unsubscribe from this group and stop receiving emai=
ls from it, send an email to <a href=3D"mailto:std-proposals+unsubscribe@is=
ocpp.org" target=3D"_blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<=
br>To post to this group, send email to <a href=3D"mailto:std-proposals@iso=
cpp.org" target=3D"_blank">std-proposals@isocpp.org</a>.</p></div></div><p =
class=3D"MsoNormal">To view this discussion on the web visit <a href=3D"htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq2sdDK05--8=
5eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com?utm_medium=3Demail&=
amp;utm_source=3Dfooter" target=3D"_blank">https://groups.google.com/a/<wbr=
>isocpp.org/d/msgid/std-<wbr>proposals/CALmDwq2sdDK05--<wbr>85eo%3DeNRceVjq=
RA1-W7DLVof0h%<wbr>2BJ0jjVgMw%40mail.gmail.com</a>.</p><p class=3D"MsoNorma=
l">=C2=A0</p></div></div><p class=3D"MsoNormal">-- <br>You received this me=
ssage because you are subscribed to the Google Groups &quot;ISO C++ Standar=
d - Future Proposals&quot; group.<br>To unsubscribe from this group and sto=
p receiving emails from it, send an email to <a href=3D"mailto:std-proposal=
s+unsubscribe@isocpp.org" target=3D"_blank">std-proposals+unsubscribe@<wbr>=
isocpp.org</a>.<br>To post to this group, send email to <a href=3D"mailto:s=
td-proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a>.<br=
>To view this discussion on the web visit <a href=3D"https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/5ad36f81.c614620a.ddf08.2250%40mx.go=
ogle.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">http=
s://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/5ad36f81=
..c614620a.<wbr>ddf08.2250%40mx.google.com</a>.</p></blockquote></div><p cla=
ss=3D"MsoNormal">=C2=A0</p></div></div></div><div><div><p class=3D"MsoNorma=
l">-- <br>You received this message because you are subscribed to the Googl=
e Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br>To unsub=
scribe from this group and stop receiving emails from it, send an email to =
<a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank">s=
td-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>To post to this group, sen=
d email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">st=
d-proposals@isocpp.org</a>.</p></div></div><p class=3D"MsoNormal">To view t=
his discussion on the web visit <a href=3D"https://groups.google.com/a/isoc=
pp.org/d/msgid/std-proposals/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2=
ByLiz1oJg%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" targ=
et=3D"_blank">https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>=
proposals/<wbr>CALmDwq1oGuP3Bj3AfHVnJK2eozRWZ<wbr>Z%3DOjf6AQaQPB%2ByLiz1oJg=
%<wbr>40mail.gmail.com</a>.</p><p class=3D"MsoNormal">=C2=A0</p></div></div=
><p class=3D"MsoNormal">-- <br>You received this message because you are su=
bscribed to the Google Groups &quot;ISO C++ Standard - Future Proposals&quo=
t; group.<br>To unsubscribe from this group and stop receiving emails from =
it, send an email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org=
" target=3D"_blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>To po=
st to this group, send email to <a href=3D"mailto:std-proposals@isocpp.org"=
 target=3D"_blank">std-proposals@isocpp.org</a>.<br>To view this discussion=
 on the web visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid=
/std-proposals/5ad37a5f.d164650a.b857a.760b%40mx.google.com?utm_medium=3Dem=
ail&amp;utm_source=3Dfooter" target=3D"_blank">https://groups.google.com/a/=
<wbr>isocpp.org/d/msgid/std-<wbr>proposals/5ad37a5f.d164650a.<wbr>b857a.760=
b%40mx.google.com</a>.</p></blockquote></div><p class=3D"MsoNormal"><u></u>=
=C2=A0<u></u></p></div><p class=3D"MsoNormal">-- <br>You received this mess=
age 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 email to <a href=3D"mailto:std-proposals+=
unsubscribe@isocpp.org" target=3D"_blank">std-proposals+unsubscribe@<wbr>is=
ocpp.org</a>.<br>To post to this group, send email to <a href=3D"mailto:std=
-proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>T=
o view this discussion on the web visit <a href=3D"https://groups.google.co=
m/a/isocpp.org/d/msgid/std-proposals/CALmDwq0tZUjRMpD7i_pwKS_G2%2BgvwCH5T%2=
BaJEypujVuEx68%3DNQ%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfo=
oter" target=3D"_blank">https://groups.google.com/a/<wbr>isocpp.org/d/msgid=
/std-<wbr>proposals/CALmDwq0tZUjRMpD7i_<wbr>pwKS_G2%2BgvwCH5T%<wbr>2BaJEypu=
jVuEx68%3DNQ%40mail.<wbr>gmail.com</a>.</p><p class=3D"MsoNormal"><u></u>=
=C2=A0<u></u></p></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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">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/5ad38837.435a620a.8b39e.a4c7%40mx.goo=
gle.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">https=
://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/5ad38837.=
435a620a.<wbr>8b39e.a4c7%40mx.google.com</a>.<br>
<br></div>
<br></div></div></div></div><div><div class=3D"h5">

<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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></div></div>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/20180415172201.5099602.60688.50265%40=
gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">htt=
ps://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/2018041=
5172201.<wbr>5099602.60688.50265%40gmail.<wbr>com</a>.<br>
</blockquote></div><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/CAKiZDp09nHdGRvboiTe2OfhOE0J8JqutAhko=
K3DU8cZeuiHqKQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAKiZDp09nHdGRvbo=
iTe2OfhOE0J8JqutAhkoK3DU8cZeuiHqKQ%40mail.gmail.com</a>.<br />

--00000000000017252f0569e66744--

.


Author: "dgutson ." <danielgutson@gmail.com>
Date: Sun, 15 Apr 2018 17:42:26 +0000
Raw View
--f403043af5889aa3390569e6a1d4
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

El dom., 15 de abril de 2018 14:26, Patrice Roy <patricer@gmail.com>
escribi=C3=B3:

> Sounds like a cool song title for geeks :)
>
> 2018-04-15 13:22 GMT-04:00 Tony V E <tvaneerd@gmail.com>:
>
>> That should have been:
>>
>> If you could name a lambda....
>>
> then you would dance a samba
because this feature is not standard
stack trace ain't look that vanguard



>> Sent from my BlackBerry portable Babbage Device
>> *From: *Tony V E
>> *Sent: *Sunday, April 15, 2018 1:20 PM
>> *To: *Ritwik Das; std-proposals@isocpp.org
>> *Subject: *Re: [std-proposals] Lambda annotations
>>
>> If you could name. Lambda, it wouldn't change how the rest of the code i=
s
>> written (ie you wouldn't use the name to call the lambda) nor how the co=
de
>> works.
>>
>> So from the standard's point of view, the name does nothing. It isn't
>> really =E2=80=8Epart of the language or the abstract machine.
>>
>> It would only affect debugging, etc. Which is beyond what the standard
>> talks about.
>>
>> So attributes would be the right tool of choice here. They have the same
>> properties.
>>
>> ie something like [[name:foo]]. Maybe we could also use the same
>> attribute for naming threads (which has been requested for the same reas=
on:
>> debugging)
>>
>> Sent from my BlackBerry portable Babbage Device
>> *From: *Ritwik Das
>> *Sent: *Sunday, April 15, 2018 1:13 PM
>> *To: *std-proposals@isocpp.org
>> *Reply To: *std-proposals@isocpp.org
>> *Subject: *RE: [std-proposals] Lambda annotations
>>
>> Isn=E2=80=99t that the same behavior when someone changes regular functi=
on names,
>> symbols for which depend on the given names based on some predefined
>> mangling rules. I don=E2=80=99t want this to be any different for lambda=
s and that
>> is what this proposal is about=E2=80=A6
>>
>>
>>
>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=3D550986> for
>> Windows 10
>>
>>
>>
>> *From: *Nicolas Lesser <blitzrakete@gmail.com>
>> *Sent: *Sunday, April 15, 2018 9:19 AM
>> *To: *std-proposals@isocpp.org
>> *Subject: *Re: [std-proposals] Lambda annotations
>>
>>
>>
>> I don't think that those annotations should change the actual symbol
>> generated, because that would mean that you could break the ABI by simpl=
y
>> changing the name of the lambda, and conflicts can happen quite quickly.=
 I
>> would rather see those names used as informal lambda name for debugging =
and
>> error reporting messages.
>>
>>
>>
>> Also, this was just an idea. Currently there is no way to do that, so
>> it's just normal that in your case they don't do anything.
>>
>>
>>
>> On Sun, Apr 15, 2018 at 6:14 PM, Ritwik Das <ritwik.sami1990@gmail.com>
>> wrote:
>>
>> Standard attributes/implementation specific attributes do not help much
>> in this case but new attributes do not affect the compiler generated nam=
es
>> I would want symbols to be generated based on the given names. I tried
>> something like this but the names are random regardless. What am I missi=
ng?
>>
>>
>>
>> #include <iostream>
>>
>>
>>
>> template<typename T>
>>
>> void func(T&& lambda)
>>
>> {
>>
>>     lambda();
>>
>> }
>>
>>
>>
>> int main()
>>
>> {
>>
>>     func([]()[[cats::meow]] {std::cout << "Hello!"; });
>>
>>     func([]() {std::cout << "world!"; });
>>
>>     return 0;
>>
>> }
>>
>>
>>
>>
>>
>>
>>
>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=3D550986> for
>> Windows 10
>>
>>
>>
>> *From: *Nicolas Lesser <blitzrakete@gmail.com>
>> *Sent: *Sunday, April 15, 2018 8:50 AM
>>
>>
>> *To: *std-proposals@isocpp.org
>> *Subject: *Re: [std-proposals] Lambda annotations
>>
>>
>>
>> Well, you could use either a new attribute or an implementation-defined
>> attribute to give the lambda a name for debugging/error reporting purpos=
es.
>>
>>
>>
>> On Sun, Apr 15, 2018 at 5:28 PM, Ritwik Das <ritwik.sami1990@gmail.com>
>> wrote:
>>
>> But I am still confused how attributes can solve the problems mentioned
>> below?
>>
>>
>>
>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=3D550986> for
>> Windows 10
>>
>>
>>
>> *From: *Nicolas Lesser <blitzrakete@gmail.com>
>> *Sent: *Sunday, April 15, 2018 1:03 AM
>> *To: *std-proposals@isocpp.org
>> *Subject: *Re: [std-proposals] Lambda annotations
>>
>>
>>
>> There was a proposal or idea once to name lambdas to be able to name the
>> lambda inside the lambda, and the syntax exactly matches what you propos=
e.
>>
>>
>>
>> Currently you can use an attribute :).
>>
>>
>>
>> On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das <ritwik.sami1990@gmail.com>
>> wrote:
>>
>> Problem:
>>
>> The fact that lambda functions are by design unnamed means that the
>> compiler has to assign names which show up in the call stack while
>> debugging and also in dumps etc. This makes things especially difficult =
for
>> automated tools which categorize dumps based on the call stack because t=
he
>> compiler assigned lambda names tend to change over time. Some specific
>> problems which occur because of the compiler assigning random names to
>> lambda functions are cited below:
>>
>>
>>
>> *Example 1:*
>>
>> *Sample code:*
>>
>> template<typename T>
>>
>> int func(T&& lambda)
>>
>> {
>>
>> lambda();
>>
>> }
>>
>>
>>
>> int main()
>>
>> {
>>
>> func([]() {std::cout << "Hello!"; });
>>
>> return 0;
>>
>> }
>>
>>
>>
>> *Compiler Error:*
>>
>> 1>lambda.cpp
>>
>> 1>\lambda.cpp(11): error C4716: 'func<<
>> *lambda_4653923a58ae9d647caab6ef4f61a443*> >': must return a value
>>
>>
>>
>> Errors like this are hard to track because the error message does not
>> really identify the source of the problem.
>>
>>
>>
>> *Example 2:*
>>
>> > ClassA::frame6 C++
>>
>>   ClassA::frame4::*__l62::<lambda>* C++
>>
>>   ClassB::frame3<lambda>(void) > C++
>>
>>   ClassA::frame2 C++
>>
>>   ClassA::frame1 C++
>>
>>
>>
>> In the above call stack, the lambda function is referred to as "__l62"
>> which neither is very useful nor does this stay invariant over time as m=
ore
>> lambdas are added to the codebase (it is not even clear how this name is
>> chosen by the compiler).
>>
>>
>>
>> Proposal:
>>
>> If there is a way for optionally annotating lambda functions with the
>> declaration, the compiler can use this to produce lambda names more
>> consistently. e.g. The strawman syntax can be something like: "[=3D]
>> *mylambda1*() {...}". This might seem counter-intuitive since lambdas
>> are defined to be *anonymous* functions, adding an optional annotation
>> to the lambda does not really take away the benefits of using lambdas ov=
er
>> functions but rather makes it more powerful.
>>
>>
>>
>> P.S.:
>>
>> Apologies if I missed proposals which addresses the above problem.
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/5225897d-fa=
81-4137-928d-f97fcb4f2efe%40isocpp.org
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5225897d-f=
a81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoo=
ter>
>> .
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/CALmDwq2sdD=
K05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq2sd=
DK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com?utm_medium=
=3Demail&utm_source=3Dfooter>
>> .
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/5ad36f81.c6=
14620a.ddf08.2250%40mx.google.com
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad36f81.c=
614620a.ddf08.2250%40mx.google.com?utm_medium=3Demail&utm_source=3Dfooter>
>> .
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/CALmDwq1oGu=
P3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq1oG=
uP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com?utm_medium=
=3Demail&utm_source=3Dfooter>
>> .
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/5ad37a5f.d1=
64650a.b857a.760b%40mx.google.com
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad37a5f.d=
164650a.b857a.760b%40mx.google.com?utm_medium=3Demail&utm_source=3Dfooter>
>> .
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/CALmDwq0tZU=
jRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68%3DNQ%40mail.gmail.com
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq0tZ=
UjRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68%3DNQ%40mail.gmail.com?utm_medium=
=3Demail&utm_source=3Dfooter>
>> .
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/5ad38837.43=
5a620a.8b39e.a4c7%40mx.google.com
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad38837.4=
35a620a.8b39e.a4c7%40mx.google.com?utm_medium=3Demail&utm_source=3Dfooter>
>> .
>>
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/20180415172=
201.5099602.60688.50265%40gmail.com
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/2018041517=
2201.5099602.60688.50265%40gmail.com?utm_medium=3Demail&utm_source=3Dfooter=
>
>> .
>>
>
> --
> 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/CAKiZDp09nHd=
GRvboiTe2OfhOE0J8JqutAhkoK3DU8cZeuiHqKQ%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAKiZDp09nH=
dGRvboiTe2OfhOE0J8JqutAhkoK3DU8cZeuiHqKQ%40mail.gmail.com?utm_medium=3Demai=
l&utm_source=3Dfooter>
> .
>

--=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/CAFdMc-3m0VbPLmFztjQiSS2anXmnDeJUuAGMV8BMdvzHaEH=
yfw%40mail.gmail.com.

--f403043af5889aa3390569e6a1d4
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr">=
El dom., 15 de abril de 2018 14:26, Patrice Roy &lt;<a href=3D"mailto:patri=
cer@gmail.com">patricer@gmail.com</a>&gt; escribi=C3=B3:<br></div><blockquo=
te class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc so=
lid;padding-left:1ex"><div dir=3D"ltr">Sounds like a cool song title for ge=
eks :)<br></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">2=
018-04-15 13:22 GMT-04:00 Tony V E <span dir=3D"ltr">&lt;<a href=3D"mailto:=
tvaneerd@gmail.com" target=3D"_blank" rel=3D"noreferrer">tvaneerd@gmail.com=
</a>&gt;</span>:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link=3D"blue" vlink=
=3D"#954F72" style=3D"background-color:rgb(255,255,255);line-height:initial=
" lang=3D"en-US">                                                          =
                            <div style=3D"width:100%;font-size:initial;font=
-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,1=
25);text-align:initial;background-color:rgb(255,255,255)">That should have =
been:</div><div style=3D"width:100%;font-size:initial;font-family:Calibri,&=
#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:in=
itial;background-color:rgb(255,255,255)"><br></div><div style=3D"width:100%=
;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-=
serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,=
255)">If you could name a lambda....</div></div></blockquote></div></div></=
blockquote></div></div><div dir=3D"auto">then you would dance a samba</div>=
<div dir=3D"auto">because this feature is not standard</div><div dir=3D"aut=
o">stack trace ain&#39;t look that vanguard</div><div dir=3D"auto"><br></di=
v><div dir=3D"auto"><br></div><div dir=3D"auto"><div class=3D"gmail_quote">=
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"gmail_extra"><div class=3D"gma=
il_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div link=3D"blue" vlink=3D"#954F7=
2" style=3D"background-color:rgb(255,255,255);line-height:initial" lang=3D"=
en-US"><span>                                                              =
                                                                       <div=
 style=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#=
39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;backgroun=
d-color:rgb(255,255,255)"><br style=3D"display:initial"></div>             =
                                                                           =
                                                                           =
                                <div style=3D"font-size:initial;font-family=
:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);tex=
t-align:initial;background-color:rgb(255,255,255)">Sent=C2=A0from=C2=A0my=
=C2=A0BlackBerry=C2=A0portable=C2=A0Babbage=C2=A0Device</div>              =
                                                                           =
                                                                           =
              </span><table style=3D"background-color:white;border-spacing:=
0px" width=3D"100%"> <tbody><tr><td colspan=3D"2" style=3D"font-size:initia=
l;text-align:initial;background-color:rgb(255,255,255)">                   =
        <div style=3D"border-style:solid none none;border-top-color:rgb(181=
,196,223);border-top-width:1pt;padding:3pt 0in 0in;font-family:Tahoma,&#39;=
BB Alpha Sans&#39;,&#39;Slate Pro&#39;;font-size:10pt">  <div><b>From: </b>=
Tony V E</div><div><b>Sent: </b>Sunday, April 15, 2018 1:20 PM</div><div><b=
>To: </b>Ritwik Das; <a href=3D"mailto:std-proposals@isocpp.org" target=3D"=
_blank" rel=3D"noreferrer">std-proposals@isocpp.org</a></div><div><div clas=
s=3D"m_3574755910641815072h5"><div><b>Subject: </b>Re: [std-proposals] Lamb=
da annotations</div></div></div></div></td></tr></tbody></table><div><div c=
lass=3D"m_3574755910641815072h5"><div style=3D"border-style:solid none none=
;border-top-color:rgb(186,188,209);border-top-width:1pt;font-size:initial;t=
ext-align:initial;background-color:rgb(255,255,255)"></div><br><div id=3D"m=
_3574755910641815072m_3176913255906977344_originalContent">                =
                                                                      <div =
style=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#3=
9;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background=
-color:rgb(255,255,255)">If you could name. Lambda, it wouldn&#39;t change =
how the rest of the code is written (ie you wouldn&#39;t use the name to ca=
ll the lambda) nor how the code works.=C2=A0</div><div style=3D"width:100%;=
font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-s=
erif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,2=
55)"><br></div><div style=3D"width:100%;font-size:initial;font-family:Calib=
ri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-alig=
n:initial;background-color:rgb(255,255,255)">So from the standard&#39;s poi=
nt of view, the name does nothing. It isn&#39;t really =E2=80=8Epart of the=
 language or the abstract machine.</div><div style=3D"width:100%;font-size:=
initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color=
:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)"><br><=
/div><div style=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Sl=
ate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;=
background-color:rgb(255,255,255)">It would only affect debugging, etc. Whi=
ch is beyond what the standard talks about.</div><div style=3D"width:100%;f=
ont-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-se=
rif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,25=
5)"><br></div><div style=3D"width:100%;font-size:initial;font-family:Calibr=
i,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align=
:initial;background-color:rgb(255,255,255)">So attributes would be the righ=
t tool of choice here. They have the same properties.=C2=A0</div><div style=
=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sa=
ns-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-colo=
r:rgb(255,255,255)"><br></div><div style=3D"width:100%;font-size:initial;fo=
nt-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73=
,125);text-align:initial;background-color:rgb(255,255,255)">ie something li=
ke [[name:foo]]. Maybe we could also use the same attribute for naming thre=
ads (which has been requested for the same reason: debugging) </div>       =
                                                                           =
                                                   <div style=3D"width:100%=
;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-=
serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,=
255)"><br style=3D"display:initial"></div>                                 =
                                                                           =
                                                                           =
            <div style=3D"font-size:initial;font-family:Calibri,&#39;Slate =
Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;back=
ground-color:rgb(255,255,255)">Sent=C2=A0from=C2=A0my=C2=A0BlackBerry=C2=A0=
portable=C2=A0Babbage=C2=A0Device</div>                                    =
                                                                           =
                                                                   <table s=
tyle=3D"background-color:white;border-spacing:0px" width=3D"100%"> <tbody><=
tr><td colspan=3D"2" style=3D"font-size:initial;text-align:initial;backgrou=
nd-color:rgb(255,255,255)">                           <div style=3D"border-=
style:solid none none;border-top-color:rgb(181,196,223);border-top-width:1p=
t;padding:3pt 0in 0in;font-family:Tahoma,&#39;BB Alpha Sans&#39;,&#39;Slate=
 Pro&#39;;font-size:10pt">  <div><b>From: </b>Ritwik Das</div><div><b>Sent:=
 </b>Sunday, April 15, 2018 1:13 PM</div><div><b>To: </b><a href=3D"mailto:=
std-proposals@isocpp.org" target=3D"_blank" rel=3D"noreferrer">std-proposal=
s@isocpp.org</a></div><div><b>Reply To: </b><a href=3D"mailto:std-proposals=
@isocpp.org" target=3D"_blank" rel=3D"noreferrer">std-proposals@isocpp.org<=
/a></div><div><b>Subject: </b>RE: [std-proposals] Lambda annotations</div><=
/div></td></tr></tbody></table><div style=3D"border-style:solid none none;b=
order-top-color:rgb(186,188,209);border-top-width:1pt;font-size:initial;tex=
t-align:initial;background-color:rgb(255,255,255)"></div><br><div id=3D"m_3=
574755910641815072m_3176913255906977344_originalContent"><div class=3D"m_35=
74755910641815072m_3176913255906977344WordSection1"><p class=3D"MsoNormal">=
Isn=E2=80=99t that the same behavior when someone changes regular function =
names, symbols for which depend on the given names based on some predefined=
 mangling rules. I don=E2=80=99t want this to be any different for lambdas =
and that is what this proposal is about=E2=80=A6</p><p class=3D"MsoNormal">=
<u></u>=C2=A0<u></u></p><p class=3D"MsoNormal">Sent from <a href=3D"https:/=
/go.microsoft.com/fwlink/?LinkId=3D550986" target=3D"_blank" rel=3D"norefer=
rer">Mail</a> for Windows 10</p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u>=
</p><div style=3D"border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt =
0in 0in 0in"><p class=3D"MsoNormal" style=3D"border:none;padding:0in"><b>Fr=
om: </b><a href=3D"mailto:blitzrakete@gmail.com" target=3D"_blank" rel=3D"n=
oreferrer">Nicolas Lesser</a><br><b>Sent: </b>Sunday, April 15, 2018 9:19 A=
M<br><b>To: </b><a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blan=
k" rel=3D"noreferrer">std-proposals@isocpp.org</a><br><b>Subject: </b>Re: [=
std-proposals] Lambda annotations</p></div><p class=3D"MsoNormal"><u></u>=
=C2=A0<u></u></p><div><p class=3D"MsoNormal">I don&#39;t think that those a=
nnotations should change the actual symbol generated, because that would me=
an that you could break the ABI by simply changing the name of the lambda, =
and conflicts can happen quite quickly. I would rather see those names used=
 as informal lambda name for debugging and error reporting messages.</p><di=
v><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"Mso=
Normal">Also, this was just an idea. Currently there is no way to do that, =
so it&#39;s just normal that in your case they don&#39;t do anything.</p></=
div></div><div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><div><p class=
=3D"MsoNormal">On Sun, Apr 15, 2018 at 6:14 PM, Ritwik Das &lt;<a href=3D"m=
ailto:ritwik.sami1990@gmail.com" target=3D"_blank" rel=3D"noreferrer">ritwi=
k.sami1990@gmail.com</a>&gt; wrote:</p><blockquote style=3D"border:none;bor=
der-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;ma=
rgin-right:0in"><div><div><p class=3D"MsoNormal">Standard attributes/implem=
entation specific attributes do not help much in this case but new attribut=
es do not affect the compiler generated names I would want symbols to be ge=
nerated based on the given names. I tried something like this but the names=
 are random regardless. What am I missing?</p><p class=3D"MsoNormal">=C2=A0=
</p><div><div><div><p class=3D"MsoNormal"><span style=3D"color:blue">#inclu=
de</span><span style=3D"color:black"> &lt;iostream&gt;</span></p></div><p c=
lass=3D"MsoNormal">=C2=A0</p><div><p class=3D"MsoNormal"><span style=3D"col=
or:blue">template</span><span style=3D"color:black">&lt;</span><span style=
=3D"color:blue">typename</span><span style=3D"color:black"> T&gt;</span></p=
></div><div><p class=3D"MsoNormal"><span style=3D"color:blue">void</span><s=
pan style=3D"color:black"> func(T&amp;&amp; lambda)</span></p></div><div><p=
 class=3D"MsoNormal"><span style=3D"color:black">{</span></p></div><div><p =
class=3D"MsoNormal"><span style=3D"color:black">=C2=A0=C2=A0=C2=A0=C2=A0lam=
bda();</span></p></div><div><p class=3D"MsoNormal"><span style=3D"color:bla=
ck">}</span></p></div><p class=3D"MsoNormal">=C2=A0</p><div><p class=3D"Mso=
Normal"><span style=3D"color:blue">int</span><span style=3D"color:black"> m=
ain()</span></p></div><div><p class=3D"MsoNormal"><span style=3D"color:blac=
k">{</span></p></div><div><p class=3D"MsoNormal"><span style=3D"color:black=
">=C2=A0=C2=A0=C2=A0=C2=A0func([]()</span><span style=3D"color:gray">[[cats=
::meow]]</span><span style=3D"color:black"> {std::cout &lt;&lt; </span><spa=
n style=3D"color:#a31515">&quot;Hello!&quot;</span><span style=3D"color:bla=
ck">; });</span></p></div><div><p class=3D"MsoNormal"><span style=3D"color:=
black">=C2=A0=C2=A0=C2=A0=C2=A0func([]() {std::cout &lt;&lt; </span><span s=
tyle=3D"color:#a31515">&quot;world!&quot;</span><span style=3D"color:black"=
>; });</span></p></div><div><p class=3D"MsoNormal"><span style=3D"color:bla=
ck">=C2=A0=C2=A0=C2=A0=C2=A0</span><span style=3D"color:blue">return</span>=
<span style=3D"color:black"> </span><span style=3D"color:#09885a">0</span><=
span style=3D"color:black">;</span></p></div><div><p class=3D"MsoNormal"><s=
pan style=3D"color:black">}</span></p></div><p class=3D"MsoNormal">=C2=A0</=
p></div></div><p class=3D"MsoNormal">=C2=A0</p><p class=3D"MsoNormal">=C2=
=A0</p><p class=3D"MsoNormal">Sent from <a href=3D"https://go.microsoft.com=
/fwlink/?LinkId=3D550986" target=3D"_blank" rel=3D"noreferrer">Mail</a> for=
 Windows 10</p><p class=3D"MsoNormal">=C2=A0</p><div style=3D"border:none;b=
order-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class=3D"MsoNor=
mal"><b>From: </b><a href=3D"mailto:blitzrakete@gmail.com" target=3D"_blank=
" rel=3D"noreferrer">Nicolas Lesser</a><br><b>Sent: </b>Sunday, April 15, 2=
018 8:50 AM</p><div><div><p class=3D"MsoNormal"><br><b>To: </b><a href=3D"m=
ailto:std-proposals@isocpp.org" target=3D"_blank" rel=3D"noreferrer">std-pr=
oposals@isocpp.org</a><br><b>Subject: </b>Re: [std-proposals] Lambda annota=
tions</p></div></div></div><div><div><p class=3D"MsoNormal">=C2=A0</p><div>=
<p class=3D"MsoNormal">Well, you could use either a new attribute or an imp=
lementation-defined attribute to give the lambda a name for debugging/error=
 reporting purposes.</p></div><div><p class=3D"MsoNormal">=C2=A0</p><div><p=
 class=3D"MsoNormal">On Sun, Apr 15, 2018 at 5:28 PM, Ritwik Das &lt;<a hre=
f=3D"mailto:ritwik.sami1990@gmail.com" target=3D"_blank" rel=3D"noreferrer"=
>ritwik.sami1990@gmail.com</a>&gt; wrote:</p><blockquote style=3D"border:no=
ne;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.=
8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt"><div><div><p cla=
ss=3D"MsoNormal">But I am still confused how attributes can solve the probl=
ems mentioned below?</p><p class=3D"MsoNormal">=C2=A0</p><p class=3D"MsoNor=
mal">Sent from <a href=3D"https://go.microsoft.com/fwlink/?LinkId=3D550986"=
 target=3D"_blank" rel=3D"noreferrer">Mail</a> for Windows 10</p><p class=
=3D"MsoNormal">=C2=A0</p><div style=3D"border:none;border-top:solid #e1e1e1=
 1.0pt;padding:3.0pt 0in 0in 0in"><p class=3D"MsoNormal"><b>From: </b><a hr=
ef=3D"mailto:blitzrakete@gmail.com" target=3D"_blank" rel=3D"noreferrer">Ni=
colas Lesser</a><br><b>Sent: </b>Sunday, April 15, 2018 1:03 AM<br><b>To: <=
/b><a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank" rel=3D"nor=
eferrer">std-proposals@isocpp.org</a><br><b>Subject: </b>Re: [std-proposals=
] Lambda annotations</p></div><div><div><p class=3D"MsoNormal">=C2=A0</p><d=
iv><p class=3D"MsoNormal">There was a proposal or idea once to name lambdas=
 to be able to name the lambda inside the lambda, and the syntax exactly ma=
tches what you propose.</p><div><p class=3D"MsoNormal">=C2=A0</p></div><div=
><p class=3D"MsoNormal">Currently you can use an attribute :).</p></div></d=
iv><div><p class=3D"MsoNormal">=C2=A0</p><div><p class=3D"MsoNormal">On Sun=
, Apr 15, 2018 at 9:28 AM, Ritwik Das &lt;<a href=3D"mailto:ritwik.sami1990=
@gmail.com" target=3D"_blank" rel=3D"noreferrer">ritwik.sami1990@gmail.com<=
/a>&gt; wrote:</p><blockquote style=3D"border:none;border-left:solid #ccccc=
c 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin=
-right:0in;margin-bottom:5.0pt"><div><p class=3D"MsoNormal"><span style=3D"=
font-size:13.5pt">Problem:</span></p><div><p class=3D"MsoNormal">The fact t=
hat lambda functions are by design unnamed means that the compiler has to a=
ssign names which show up in the call stack while debugging and also in dum=
ps etc. This makes things especially difficult for automated tools which ca=
tegorize dumps based on the call stack because the compiler assigned lambda=
 names tend to change over time. Some specific problems which occur because=
 of the compiler assigning random names to lambda functions are cited below=
:</p></div><div><p class=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"Mso=
Normal"><b>Example 1:</b></p></div><div><p class=3D"MsoNormal"><u>Sample co=
de:</u></p></div><div><div><p class=3D"MsoNormal">template&lt;typename T&gt=
;</p></div><div><p class=3D"MsoNormal">int func(T&amp;&amp; lambda)</p></di=
v><div><p class=3D"MsoNormal">{</p></div><div><p class=3D"MsoNormal">lambda=
();</p></div><div><p class=3D"MsoNormal">}</p></div><div><p class=3D"MsoNor=
mal">=C2=A0</p></div><div><p class=3D"MsoNormal">int main()</p></div><div><=
p class=3D"MsoNormal">{</p></div><div><p class=3D"MsoNormal">func([]() {std=
::cout &lt;&lt; &quot;Hello!&quot;; });</p></div><div><p class=3D"MsoNormal=
">return 0;</p></div><div><p class=3D"MsoNormal">}</p></div></div><div><p c=
lass=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNormal"><u>Compiler =
Error:</u></p></div><div><div><p class=3D"MsoNormal">1&gt;lambda.cpp</p></d=
iv><div><p class=3D"MsoNormal">1&gt;\lambda.cpp(11): error C4716: &#39;func=
&lt;&lt;<b>lambda_4653923a58ae9d647caab6ef4f61a443</b>&gt; &gt;&#39;: must =
return a value</p></div></div><div><p class=3D"MsoNormal">=C2=A0</p></div><=
div><p class=3D"MsoNormal">Errors like this are hard to track because the e=
rror message does not really identify the source of the problem.</p></div><=
div><p class=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNormal"><b>E=
xample 2:</b></p></div><div><div><p class=3D"MsoNormal">&gt; ClassA::frame6=
 C++</p></div><div><p class=3D"MsoNormal">=C2=A0 ClassA::frame4::<b>__l62::=
&lt;lambda&gt;</b> C++</p></div><div><p class=3D"MsoNormal">=C2=A0 ClassB::=
frame3&lt;lambda&gt;(void) &gt; C++</p></div><div><p class=3D"MsoNormal">=
=C2=A0 ClassA::frame2 C++</p></div><div><p class=3D"MsoNormal">=C2=A0 Class=
A::frame1 C++</p></div></div><div><p class=3D"MsoNormal">=C2=A0</p></div><d=
iv><p class=3D"MsoNormal">In the above call stack, the lambda function is r=
eferred to as &quot;__l62&quot; which neither is very useful nor does this =
stay invariant over time as more lambdas are added to the codebase (it is n=
ot even clear how this name is chosen by the compiler).</p></div><div><p cl=
ass=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNormal"><span style=
=3D"font-size:13.5pt">Proposal:</span></p></div><div><p class=3D"MsoNormal"=
>If there is a way for optionally annotating lambda functions with the decl=
aration, the compiler can use this to produce lambda names more consistentl=
y. e.g. The strawman syntax can be something like: &quot;[=3D] <b>mylambda1=
</b>() {...}&quot;. This might seem counter-intuitive since lambdas are def=
ined to be <i>anonymous</i> functions, adding an optional annotation to the=
 lambda does not really take away the benefits of using lambdas over functi=
ons but rather makes it more powerful.</p></div><div><p class=3D"MsoNormal"=
>=C2=A0</p></div><div><p class=3D"MsoNormal">P.S.:</p></div><div><p class=
=3D"MsoNormal">Apologies if I missed proposals which addresses the above pr=
oblem.</p></div></div><p class=3D"MsoNormal"><span class=3D"m_3574755910641=
815072m_3176913255906977344m6031191767155126304m4195605197699100460hoenzb">=
<span style=3D"color:#888888">-- </span></span><span style=3D"color:#888888=
"><br><span class=3D"m_3574755910641815072m_3176913255906977344m60311917671=
55126304m4195605197699100460hoenzb">You received this message because you a=
re subscribed to the Google Groups &quot;ISO C++ Standard - Future Proposal=
s&quot; group.</span><br><span class=3D"m_3574755910641815072m_317691325590=
6977344m6031191767155126304m4195605197699100460hoenzb">To unsubscribe from =
this group and stop receiving emails from it, send an email to <a href=3D"m=
ailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank" rel=3D"norefe=
rrer">std-proposals+unsubscribe@isocpp.org</a>.</span><br><span class=3D"m_=
3574755910641815072m_3176913255906977344m6031191767155126304m41956051976991=
00460hoenzb">To post to this group, send email to <a href=3D"mailto:std-pro=
posals@isocpp.org" target=3D"_blank" rel=3D"noreferrer">std-proposals@isocp=
p.org</a>.</span><br><span class=3D"m_3574755910641815072m_3176913255906977=
344m6031191767155126304m4195605197699100460hoenzb">To view this discussion =
on the web visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/=
std-proposals/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=
=3Demail&amp;utm_source=3Dfooter" target=3D"_blank" rel=3D"noreferrer">http=
s://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5225897d-fa81-4137=
-928d-f97fcb4f2efe%40isocpp.org</a>.</span></span></p></blockquote></div><p=
 class=3D"MsoNormal">=C2=A0</p></div></div></div><div><div><p class=3D"MsoN=
ormal">-- <br>You received this message because you are subscribed to the G=
oogle Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br>To u=
nsubscribe from this group and stop receiving emails from it, send an email=
 to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blan=
k" rel=3D"noreferrer">std-proposals+unsubscribe@isocpp.org</a>.<br>To post =
to this group, send email to <a href=3D"mailto:std-proposals@isocpp.org" ta=
rget=3D"_blank" rel=3D"noreferrer">std-proposals@isocpp.org</a>.</p></div><=
/div><p class=3D"MsoNormal">To view this discussion on the web visit <a hre=
f=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq2s=
dDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com?utm_medium=
=3Demail&amp;utm_source=3Dfooter" target=3D"_blank" rel=3D"noreferrer">http=
s://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq2sdDK05--85=
eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com</a>.</p><p class=3D"=
MsoNormal">=C2=A0</p></div></div><p class=3D"MsoNormal">-- <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 email to <a href=3D"mailto:std-=
proposals+unsubscribe@isocpp.org" target=3D"_blank" rel=3D"noreferrer">std-=
proposals+unsubscribe@isocpp.org</a>.<br>To post to this group, send email =
to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank" rel=3D"nor=
eferrer">std-proposals@isocpp.org</a>.<br>To view this discussion on the we=
b visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-propo=
sals/5ad36f81.c614620a.ddf08.2250%40mx.google.com?utm_medium=3Demail&amp;ut=
m_source=3Dfooter" target=3D"_blank" rel=3D"noreferrer">https://groups.goog=
le.com/a/isocpp.org/d/msgid/std-proposals/5ad36f81.c614620a.ddf08.2250%40mx=
..google.com</a>.</p></blockquote></div><p class=3D"MsoNormal">=C2=A0</p></d=
iv></div></div><div><div><p class=3D"MsoNormal">-- <br>You received this me=
ssage because you are subscribed to the Google Groups &quot;ISO C++ Standar=
d - Future Proposals&quot; group.<br>To unsubscribe from this group and sto=
p receiving emails from it, send an email to <a href=3D"mailto:std-proposal=
s+unsubscribe@isocpp.org" target=3D"_blank" rel=3D"noreferrer">std-proposal=
s+unsubscribe@isocpp.org</a>.<br>To post to this group, send email to <a hr=
ef=3D"mailto:std-proposals@isocpp.org" target=3D"_blank" rel=3D"noreferrer"=
>std-proposals@isocpp.org</a>.</p></div></div><p class=3D"MsoNormal">To vie=
w this discussion on the web visit <a href=3D"https://groups.google.com/a/i=
socpp.org/d/msgid/std-proposals/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQP=
B%2ByLiz1oJg%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" t=
arget=3D"_blank" rel=3D"noreferrer">https://groups.google.com/a/isocpp.org/=
d/msgid/std-proposals/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1o=
Jg%40mail.gmail.com</a>.</p><p class=3D"MsoNormal">=C2=A0</p></div></div><p=
 class=3D"MsoNormal">-- <br>You received this message because you are subsc=
ribed 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 email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" t=
arget=3D"_blank" rel=3D"noreferrer">std-proposals+unsubscribe@isocpp.org</a=
>.<br>To post to this group, send email to <a href=3D"mailto:std-proposals@=
isocpp.org" target=3D"_blank" rel=3D"noreferrer">std-proposals@isocpp.org</=
a>.<br>To view this discussion on the web visit <a href=3D"https://groups.g=
oogle.com/a/isocpp.org/d/msgid/std-proposals/5ad37a5f.d164650a.b857a.760b%4=
0mx.google.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank=
" rel=3D"noreferrer">https://groups.google.com/a/isocpp.org/d/msgid/std-pro=
posals/5ad37a5f.d164650a.b857a.760b%40mx.google.com</a>.</p></blockquote></=
div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><p class=3D"MsoNor=
mal">-- <br>You received this message because you are subscribed to the Goo=
gle Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br>To uns=
ubscribe from this group and stop receiving emails from it, send an email t=
o <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank"=
 rel=3D"noreferrer">std-proposals+unsubscribe@isocpp.org</a>.<br>To post to=
 this group, send email to <a href=3D"mailto:std-proposals@isocpp.org" targ=
et=3D"_blank" rel=3D"noreferrer">std-proposals@isocpp.org</a>.<br>To view t=
his discussion on the web visit <a href=3D"https://groups.google.com/a/isoc=
pp.org/d/msgid/std-proposals/CALmDwq0tZUjRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypuj=
VuEx68%3DNQ%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" ta=
rget=3D"_blank" rel=3D"noreferrer">https://groups.google.com/a/isocpp.org/d=
/msgid/std-proposals/CALmDwq0tZUjRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68%3=
DNQ%40mail.gmail.com</a>.</p><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p=
></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" target=3D"_=
blank" rel=3D"noreferrer">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank" rel=3D"noreferrer">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/5ad38837.435a620a.8b39e.a4c7%40mx.goo=
gle.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank" rel=
=3D"noreferrer">https://groups.google.com/a/isocpp.org/d/msgid/std-proposal=
s/5ad38837.435a620a.8b39e.a4c7%40mx.google.com</a>.<br>
<br></div>
<br></div></div></div></div><div><div class=3D"m_3574755910641815072h5">

<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" target=3D"_=
blank" rel=3D"noreferrer">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank" rel=3D"noreferrer">std-proposals@isocpp.org</a>.<br=
></div></div>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/20180415172201.5099602.60688.50265%40=
gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank" rel=
=3D"noreferrer">https://groups.google.com/a/isocpp.org/d/msgid/std-proposal=
s/20180415172201.5099602.60688.50265%40gmail.com</a>.<br>
</blockquote></div><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" target=3D"_=
blank" rel=3D"noreferrer">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank" rel=3D"noreferrer">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/CAKiZDp09nHdGRvboiTe2OfhOE0J8JqutAhko=
K3DU8cZeuiHqKQ%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter"=
 target=3D"_blank" rel=3D"noreferrer">https://groups.google.com/a/isocpp.or=
g/d/msgid/std-proposals/CAKiZDp09nHdGRvboiTe2OfhOE0J8JqutAhkoK3DU8cZeuiHqKQ=
%40mail.gmail.com</a>.<br>
</blockquote></div></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/CAFdMc-3m0VbPLmFztjQiSS2anXmnDeJUuAGM=
V8BMdvzHaEHyfw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAFdMc-3m0VbPLmFz=
tjQiSS2anXmnDeJUuAGMV8BMdvzHaEHyfw%40mail.gmail.com</a>.<br />

--f403043af5889aa3390569e6a1d4--

.


Author: Magnus Fromreide <magfr@lysator.liu.se>
Date: Sun, 15 Apr 2018 20:17:17 +0200
Raw View
But then, what would the result of a lambda with attribute name foo and a
named entity whose name get mangled to foo be? According to the standard a=
=20
name clash is forbidden, right?

On Sun, Apr 15, 2018 at 01:20:43PM -0400, Tony V E wrote:
> <html><head></head><body lang=3D"en-US" link=3D"blue" vlink=3D"#954F72" s=
tyle=3D"background-color: rgb(255, 255, 255); line-height: initial;">      =
                                                                           =
     <div style=3D"width: 100%; font-size: initial; font-family: Calibri, '=
Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: in=
itial; background-color: rgb(255, 255, 255);">If you could name. Lambda, it=
 wouldn't change how the rest of the code is written (ie you wouldn't use t=
he name to call the lambda) nor how the code works.&nbsp;</div><div style=
=3D"width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', san=
s-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; backgrou=
nd-color: rgb(255, 255, 255);"><br></div><div style=3D"width: 100%; font-si=
ze: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; col=
or: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, =
255);">So from the standard's point of view, the name does nothing. It isn'=
t really =E2=80=8Epart of the language or the abstract machine.</div><div s=
tyle=3D"width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro',=
 sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; back=
ground-color: rgb(255, 255, 255);"><br></div><div style=3D"width: 100%; fon=
t-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif;=
 color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 2=
55, 255);">It would only affect debugging, etc. Which is beyond what the st=
andard talks about.</div><div style=3D"width: 100%; font-size: initial; fon=
t-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, =
125); text-align: initial; background-color: rgb(255, 255, 255);"><br></div=
><div style=3D"width: 100%; font-size: initial; font-family: Calibri, 'Slat=
e Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initia=
l; background-color: rgb(255, 255, 255);">So attributes would be the right =
tool of choice here. They have the same properties.&nbsp;</div><div style=
=3D"width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', san=
s-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; backgrou=
nd-color: rgb(255, 255, 255);"><br></div><div style=3D"width: 100%; font-si=
ze: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; col=
or: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, =
255);">ie something like [[name:foo]]. Maybe we could also use the same att=
ribute for naming threads (which has been requested for the same reason: de=
bugging) </div>                                                            =
                                                                         <d=
iv style=3D"width: 100%; font-size: initial; font-family: Calibri, 'Slate P=
ro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: initial; =
background-color: rgb(255, 255, 255);"><br style=3D"display:initial"></div>=
                                                                           =
                                                                           =
                                             <div style=3D"font-size: initi=
al; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(3=
1, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);">Se=
nt&nbsp;from&nbsp;my&nbsp;BlackBerry&nbsp;portable&nbsp;Babbage&nbsp;Device=
</div>                                                                     =
                                                                           =
                                  <table width=3D"100%" style=3D"background=
-color:white;border-spacing:0px;"> <tbody><tr><td colspan=3D"2" style=3D"fo=
nt-size: initial; text-align: initial; background-color: rgb(255, 255, 255)=
;">                           <div style=3D"border-style: solid none none; =
border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0=
in 0in; font-family: Tahoma, 'BB Alpha Sans', 'Slate Pro'; font-size: 10pt;=
">  <div><b>From: </b>Ritwik Das</div><div><b>Sent: </b>Sunday, April 15, 2=
018 1:13 PM</div><div><b>To: </b>std-proposals@isocpp.org</div><div><b>Repl=
y To: </b>std-proposals@isocpp.org</div><div><b>Subject: </b>RE: [std-propo=
sals] Lambda annotations</div></div></td></tr></tbody></table><div style=3D=
"border-style: solid none none; border-top-color: rgb(186, 188, 209); borde=
r-top-width: 1pt; font-size: initial; text-align: initial; background-color=
: rgb(255, 255, 255);"></div><br><div id=3D"_originalContent" style=3D""><m=
eta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8"><met=
a name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)"><style=
><!--
> /* Font Definitions */
> @font-face
>  {font-family:"Cambria Math";
>  panose-1:2 4 5 3 5 4 6 3 2 4;}
> @font-face
>  {font-family:Calibri;
>  panose-1:2 15 5 2 2 2 4 3 2 4;}
> /* Style Definitions */
> p.MsoNormal, li.MsoNormal, div.MsoNormal
>  {margin:0in;
>  margin-bottom:.0001pt;
>  font-size:11.0pt;
>  font-family:"Calibri",sans-serif;}
> a:link, span.MsoHyperlink
>  {mso-style-priority:99;
>  color:blue;
>  text-decoration:underline;}
> a:visited, span.MsoHyperlinkFollowed
>  {mso-style-priority:99;
>  color:#954F72;
>  text-decoration:underline;}
> span.m6031191767155126304m4195605197699100460hoenzb
>  {mso-style-name:m_6031191767155126304m4195605197699100460hoenzb;}
> .MsoChpDefault
>  {mso-style-type:export-only;}
> @page WordSection1
>  {size:8.5in 11.0in;
>  margin:1.0in 1.0in 1.0in 1.0in;}
> div.WordSection1
>  {page:WordSection1;}
> --></style><div class=3D"WordSection1"><p class=3D"MsoNormal">Isn=E2=80=
=99t that the same behavior when someone changes regular function names, sy=
mbols for which depend on the given names based on some predefined mangling=
 rules. I don=E2=80=99t want this to be any different for lambdas and that =
is what this proposal is about=E2=80=A6</p><p class=3D"MsoNormal"><o:p>&nbs=
p;</o:p></p><p class=3D"MsoNormal">Sent from <a href=3D"https://go.microsof=
t.com/fwlink/?LinkId=3D550986">Mail</a> for Windows 10</p><p class=3D"MsoNo=
rmal"><o:p>&nbsp;</o:p></p><div style=3D"mso-element:para-border-div;border=
:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in"><p class=3D=
"MsoNormal" style=3D"border:none;padding:0in"><b>From: </b><a href=3D"mailt=
o:blitzrakete@gmail.com">Nicolas Lesser</a><br><b>Sent: </b>Sunday, April 1=
5, 2018 9:19 AM<br><b>To: </b><a href=3D"mailto:std-proposals@isocpp.org">s=
td-proposals@isocpp.org</a><br><b>Subject: </b>Re: [std-proposals] Lambda a=
nnotations</p></div><p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p><div><p cla=
ss=3D"MsoNormal">I don't think that those annotations should change the act=
ual symbol generated, because that would mean that you could break the ABI =
by simply changing the name of the lambda, and conflicts can happen quite q=
uickly. I would rather see those names used as informal lambda name for deb=
ugging and error reporting messages.</p><div><p class=3D"MsoNormal"><o:p>&n=
bsp;</o:p></p></div><div><p class=3D"MsoNormal">Also, this was just an idea=
.. Currently there is no way to do that, so it's just normal that in your ca=
se they don't do anything.</p></div></div><div><p class=3D"MsoNormal"><o:p>=
&nbsp;</o:p></p><div><p class=3D"MsoNormal">On Sun, Apr 15, 2018 at 6:14 PM=
, Ritwik Das &lt;<a href=3D"mailto:ritwik.sami1990@gmail.com" target=3D"_bl=
ank">ritwik.sami1990@gmail.com</a>&gt; wrote:</p><blockquote style=3D"borde=
r:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-lef=
t:4.8pt;margin-right:0in"><div><div><p class=3D"MsoNormal" style=3D"mso-mar=
gin-top-alt:auto;mso-margin-bottom-alt:auto">Standard attributes/implementa=
tion specific attributes do not help much in this case but new attributes d=
o not affect the compiler generated names I would want symbols to be genera=
ted based on the given names. I tried something like this but the names are=
 random regardless. What am I missing?</p><p class=3D"MsoNormal" style=3D"m=
so-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><div><div><div=
><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-=
alt:auto"><span style=3D"color:blue">#include</span><span style=3D"color:bl=
ack"> &lt;iostream&gt;</span></p></div><p class=3D"MsoNormal" style=3D"mso-=
margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><div><p class=3D"=
MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><sp=
an style=3D"color:blue">template</span><span style=3D"color:black">&lt;</sp=
an><span style=3D"color:blue">typename</span><span style=3D"color:black"> T=
&gt;</span></p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-al=
t:auto;mso-margin-bottom-alt:auto"><span style=3D"color:blue">void</span><s=
pan style=3D"color:black"> func(T&amp;&amp; lambda)</span></p></div><div><p=
 class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto"><span style=3D"color:black">{</span></p></div><div><p class=3D"MsoNo=
rmal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span st=
yle=3D"color:black">&nbsp;&nbsp;&nbsp;&nbsp;lambda();</span></p></div><div>=
<p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-a=
lt:auto"><span style=3D"color:black">}</span></p></div><p class=3D"MsoNorma=
l" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><=
div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bott=
om-alt:auto"><span style=3D"color:blue">int</span><span style=3D"color:blac=
k"> main()</span></p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-=
top-alt:auto;mso-margin-bottom-alt:auto"><span style=3D"color:black">{</spa=
n></p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;ms=
o-margin-bottom-alt:auto"><span style=3D"color:black">&nbsp;&nbsp;&nbsp;&nb=
sp;func([]()</span><span style=3D"color:gray">[[cats::meow]]</span><span st=
yle=3D"color:black"> {std::cout &lt;&lt; </span><span style=3D"color:#A3151=
5">"Hello!"</span><span style=3D"color:black">; });</span></p></div><div><p=
 class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto"><span style=3D"color:black">&nbsp;&nbsp;&nbsp;&nbsp;func([]() {std::=
cout &lt;&lt; </span><span style=3D"color:#A31515">"world!"</span><span sty=
le=3D"color:black">; });</span></p></div><div><p class=3D"MsoNormal" style=
=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style=3D"colo=
r:black">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style=3D"color:blue">return</=
span><span style=3D"color:black"> </span><span style=3D"color:#09885A">0</s=
pan><span style=3D"color:black">;</span></p></div><div><p class=3D"MsoNorma=
l" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style=
=3D"color:black">}</span></p></div><p class=3D"MsoNormal" style=3D"mso-marg=
in-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div></div><p class=
=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"=
>&nbsp;</p><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-marg=
in-bottom-alt:auto">&nbsp;</p><p class=3D"MsoNormal" style=3D"mso-margin-to=
p-alt:auto;mso-margin-bottom-alt:auto">Sent from <a href=3D"https://go.micr=
osoft.com/fwlink/?LinkId=3D550986" target=3D"_blank">Mail</a> for Windows 1=
0</p><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bot=
tom-alt:auto">&nbsp;</p><div style=3D"border:none;border-top:solid #E1E1E1 =
1.0pt;padding:3.0pt 0in 0in 0in"><p class=3D"MsoNormal" style=3D"mso-margin=
-top-alt:auto;mso-margin-bottom-alt:auto"><b>From: </b><a href=3D"mailto:bl=
itzrakete@gmail.com" target=3D"_blank">Nicolas Lesser</a><br><b>Sent: </b>S=
unday, April 15, 2018 8:50 AM</p><div><div><p class=3D"MsoNormal"><br><b>To=
: </b><a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-pro=
posals@isocpp.org</a><br><b>Subject: </b>Re: [std-proposals] Lambda annotat=
ions</p></div></div></div><div><div><p class=3D"MsoNormal" style=3D"mso-mar=
gin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><div><p class=3D"Mso=
Normal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Well, =
you could use either a new attribute or an implementation-defined attribute=
 to give the lambda a name for debugging/error reporting purposes.</p></div=
><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bo=
ttom-alt:auto">&nbsp;</p><div><p class=3D"MsoNormal" style=3D"mso-margin-to=
p-alt:auto;mso-margin-bottom-alt:auto">On Sun, Apr 15, 2018 at 5:28 PM, Rit=
wik Das &lt;<a href=3D"mailto:ritwik.sami1990@gmail.com" target=3D"_blank">=
ritwik.sami1990@gmail.com</a>&gt; wrote:</p><blockquote style=3D"border:non=
e;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8=
pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt"><div><div><p clas=
s=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto=
">But I am still confused how attributes can solve the problems mentioned b=
elow?</p><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin=
-bottom-alt:auto">&nbsp;</p><p class=3D"MsoNormal" style=3D"mso-margin-top-=
alt:auto;mso-margin-bottom-alt:auto">Sent from <a href=3D"https://go.micros=
oft.com/fwlink/?LinkId=3D550986" target=3D"_blank">Mail</a> for Windows 10<=
/p><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-botto=
m-alt:auto">&nbsp;</p><div style=3D"border:none;border-top:solid #E1E1E1 1.=
0pt;padding:3.0pt 0in 0in 0in"><p class=3D"MsoNormal" style=3D"mso-margin-t=
op-alt:auto;mso-margin-bottom-alt:auto"><b>From: </b><a href=3D"mailto:blit=
zrakete@gmail.com" target=3D"_blank">Nicolas Lesser</a><br><b>Sent: </b>Sun=
day, April 15, 2018 1:03 AM<br><b>To: </b><a href=3D"mailto:std-proposals@i=
socpp.org" target=3D"_blank">std-proposals@isocpp.org</a><br><b>Subject: </=
b>Re: [std-proposals] Lambda annotations</p></div><div><div><p class=3D"Mso=
Normal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;=
</p><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin=
-bottom-alt:auto">There was a proposal or idea once to name lambdas to be a=
ble to name the lambda inside the lambda, and the syntax exactly matches wh=
at you propose.</p><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:=
auto;mso-margin-bottom-alt:auto">&nbsp;</p></div><div><p class=3D"MsoNormal=
" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Currently yo=
u can use an attribute :).</p></div></div><div><p class=3D"MsoNormal" style=
=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><div><p c=
lass=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:a=
uto">On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das &lt;<a href=3D"mailto:ritw=
ik.sami1990@gmail.com" target=3D"_blank">ritwik.sami1990@gmail.com</a>&gt; =
wrote:</p><blockquote style=3D"border:none;border-left:solid #CCCCCC 1.0pt;=
padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0=
in;margin-bottom:5.0pt"><div><p class=3D"MsoNormal" style=3D"mso-margin-top=
-alt:auto;mso-margin-bottom-alt:auto"><span style=3D"font-size:13.5pt">Prob=
lem:</span></p><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto=
;mso-margin-bottom-alt:auto">The fact that lambda functions are by design u=
nnamed means that the compiler has to assign names which show up in the cal=
l stack while debugging and also in dumps etc. This makes things especially=
 difficult for automated tools which categorize dumps based on the call sta=
ck because the compiler assigned lambda names tend to change over time. Som=
e specific problems which occur because of the compiler assigning random na=
mes to lambda functions are cited below:</p></div><div><p class=3D"MsoNorma=
l" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p><=
/div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margi=
n-bottom-alt:auto"><b>Example 1:</b></p></div><div><p class=3D"MsoNormal" s=
tyle=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><u>Sample code:=
</u></p></div><div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:=
auto;mso-margin-bottom-alt:auto">template&lt;typename T&gt;</p></div><div><=
p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-al=
t:auto">int func(T&amp;&amp; lambda)</p></div><div><p class=3D"MsoNormal" s=
tyle=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">{</p></div><div=
><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-=
alt:auto">lambda();</p></div><div><p class=3D"MsoNormal" style=3D"mso-margi=
n-top-alt:auto;mso-margin-bottom-alt:auto">}</p></div><div><p class=3D"MsoN=
ormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<=
/p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-m=
argin-bottom-alt:auto">int main()</p></div><div><p class=3D"MsoNormal" styl=
e=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">{</p></div><div><p=
 class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt=
:auto">func([]() {std::cout &lt;&lt; "Hello!"; });</p></div><div><p class=
=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"=
>return 0;</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt=
:auto;mso-margin-bottom-alt:auto">}</p></div></div><div><p class=3D"MsoNorm=
al" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p>=
</div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-marg=
in-bottom-alt:auto"><u>Compiler Error:</u></p></div><div><div><p class=3D"M=
soNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">1&gt=
;lambda.cpp</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-al=
t:auto;mso-margin-bottom-alt:auto">1&gt;\lambda.cpp(11): error C4716: 'func=
&lt;&lt;<b>lambda_4653923a58ae9d647caab6ef4f61a443</b>&gt; &gt;': must retu=
rn a value</p></div></div><div><p class=3D"MsoNormal" style=3D"mso-margin-t=
op-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div><div><p class=3D"Ms=
oNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Error=
s like this are hard to track because the error message does not really ide=
ntify the source of the problem.</p></div><div><p class=3D"MsoNormal" style=
=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div><di=
v><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom=
-alt:auto"><b>Example 2:</b></p></div><div><div><p class=3D"MsoNormal" styl=
e=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&gt; ClassA::frame=
6 C++</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto=
;mso-margin-bottom-alt:auto">&nbsp; ClassA::frame4::<b>__l62::&lt;lambda&gt=
;</b> C++</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:=
auto;mso-margin-bottom-alt:auto">&nbsp; ClassB::frame3&lt;lambda&gt;(void) =
&gt; C++</p></div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:a=
uto;mso-margin-bottom-alt:auto">&nbsp; ClassA::frame2 C++</p></div><div><p =
class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:=
auto">&nbsp; ClassA::frame1 C++</p></div></div><div><p class=3D"MsoNormal" =
style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></di=
v><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-b=
ottom-alt:auto">In the above call stack, the lambda function is referred to=
 as "__l62" which neither is very useful nor does this stay invariant over =
time as more lambdas are added to the codebase (it is not even clear how th=
is name is chosen by the compiler).</p></div><div><p class=3D"MsoNormal" st=
yle=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div>=
<div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bot=
tom-alt:auto"><span style=3D"font-size:13.5pt">Proposal:</span></p></div><d=
iv><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-botto=
m-alt:auto">If there is a way for optionally annotating lambda functions wi=
th the declaration, the compiler can use this to produce lambda names more =
consistently. e.g. The strawman syntax can be something like: "[=3D] <b>myl=
ambda1</b>() {...}". This might seem counter-intuitive since lambdas are de=
fined to be <i>anonymous</i> functions, adding an optional annotation to th=
e lambda does not really take away the benefits of using lambdas over funct=
ions but rather makes it more powerful.</p></div><div><p class=3D"MsoNormal=
" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></=
div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin=
-bottom-alt:auto">P.S.:</p></div><div><p class=3D"MsoNormal" style=3D"mso-m=
argin-top-alt:auto;mso-margin-bottom-alt:auto">Apologies if I missed propos=
als which addresses the above problem.</p></div></div><p class=3D"MsoNormal=
" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span class=
=3D"m6031191767155126304m4195605197699100460hoenzb"><span style=3D"color:#8=
88888">-- </span></span><span style=3D"color:#888888"><br><span class=3D"m6=
031191767155126304m4195605197699100460hoenzb">You received this message bec=
ause you are subscribed to the Google Groups "ISO C++ Standard - Future Pro=
posals" group.</span><br><span class=3D"m6031191767155126304m41956051976991=
00460hoenzb">To unsubscribe from this group and stop receiving emails from =
it, send an email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org=
" target=3D"_blank">std-proposals+unsubscribe@isocpp.org</a>.</span><br><sp=
an class=3D"m6031191767155126304m4195605197699100460hoenzb">To post to this=
 group, send email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D=
"_blank">std-proposals@isocpp.org</a>.</span><br><span class=3D"m6031191767=
155126304m4195605197699100460hoenzb">To view this discussion on the web vis=
it <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/=
5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=3Demail&amp;ut=
m_source=3Dfooter" target=3D"_blank">https://groups.google.com/a/isocpp.org=
/d/msgid/std-proposals/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org</a=
>.</span></span></p></blockquote></div><p class=3D"MsoNormal" style=3D"mso-=
margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div></div></div=
><div><div><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-marg=
in-bottom-alt:auto">-- <br>You received this message because you are subscr=
ibed to the Google Groups "ISO C++ Standard - Future Proposals" group.<br>T=
o unsubscribe from this group and stop receiving emails from it, send an em=
ail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_b=
lank">std-proposals+unsubscribe@isocpp.org</a>.<br>To post to this group, s=
end email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">=
std-proposals@isocpp.org</a>.</p></div></div><p class=3D"MsoNormal" style=
=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">To view this discus=
sion on the web visit <a href=3D"https://groups.google.com/a/isocpp.org/d/m=
sgid/std-proposals/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%=
40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_bla=
nk">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq2sd=
DK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com</a>.</p><p c=
lass=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margin-bottom-alt:a=
uto">&nbsp;</p></div></div><p class=3D"MsoNormal" style=3D"mso-margin-top-a=
lt:auto;mso-margin-bottom-alt:auto">-- <br>You received this message becaus=
e you are subscribed to the Google Groups "ISO C++ Standard - Future Propos=
als" group.<br>To unsubscribe from this group and stop receiving emails fro=
m it, send an email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.o=
rg" target=3D"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>To post =
to this group, send email to <a href=3D"mailto:std-proposals@isocpp.org" ta=
rget=3D"_blank">std-proposals@isocpp.org</a>.<br>To view this discussion on=
 the web visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/5ad36f81.c614620a.ddf08.2250%40mx.google.com?utm_medium=3Demail=
&amp;utm_source=3Dfooter" target=3D"_blank">https://groups.google.com/a/iso=
cpp.org/d/msgid/std-proposals/5ad36f81.c614620a.ddf08.2250%40mx.google.com<=
/a>.</p></blockquote></div><p class=3D"MsoNormal" style=3D"mso-margin-top-a=
lt:auto;mso-margin-bottom-alt:auto">&nbsp;</p></div></div></div><div><div><=
p class=3D"MsoNormal">-- <br>You received this message because you are subs=
cribed to the Google Groups "ISO C++ Standard - Future Proposals" group.<br=
>To unsubscribe from this group and stop receiving emails from it, send an =
email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"=
_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>To post to this group,=
 send email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank=
">std-proposals@isocpp.org</a>.</p></div></div><p class=3D"MsoNormal">To vi=
ew this discussion on the web visit <a href=3D"https://groups.google.com/a/=
isocpp.org/d/msgid/std-proposals/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQ=
PB%2ByLiz1oJg%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" =
target=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-propos=
als/CALmDwq1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.co=
m</a>.</p><p class=3D"MsoNormal" style=3D"mso-margin-top-alt:auto;mso-margi=
n-bottom-alt:auto">&nbsp;</p></div></div><p class=3D"MsoNormal">-- <br>You =
received this message because you are subscribed to the Google Groups "ISO =
C++ Standard - Future Proposals" group.<br>To unsubscribe from this group a=
nd stop receiving emails from it, send an email to <a href=3D"mailto:std-pr=
oposals+unsubscribe@isocpp.org" target=3D"_blank">std-proposals+unsubscribe=
@isocpp.org</a>.<br>To post to this group, send email to <a href=3D"mailto:=
std-proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a>.<b=
r>To view this discussion on the web visit <a href=3D"https://groups.google=
..com/a/isocpp.org/d/msgid/std-proposals/5ad37a5f.d164650a.b857a.760b%40mx.g=
oogle.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad37a5f.d164650a=
..b857a.760b%40mx.google.com</a>.</p></blockquote></div><p class=3D"MsoNorma=
l"><o:p>&nbsp;</o:p></p></div><p class=3D"MsoNormal">-- <br>You received th=
is message because you are subscribed to the Google Groups "ISO C++ Standar=
d - Future Proposals" group.<br>To unsubscribe from this group and stop rec=
eiving emails from it, send an email to <a href=3D"mailto:std-proposals+uns=
ubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br>To post t=
o 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 h=
ref=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq=
0tZUjRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68%3DNQ%40mail.gmail.com?utm_med=
ium=3Demail&amp;utm_source=3Dfooter">https://groups.google.com/a/isocpp.org=
/d/msgid/std-proposals/CALmDwq0tZUjRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68=
%3DNQ%40mail.gmail.com</a>.</p><p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>=
</div>
>=20
> <p></p>
>=20
> -- <br>
> You received this message because you are subscribed to the Google Groups=
 "ISO C++ Standard - Future Proposals" group.<br>
> To unsubscribe from this group and stop receiving emails from it, send an=
 email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-propo=
sals+unsubscribe@isocpp.org</a>.<br>
> To post to this group, send email to <a href=3D"mailto:std-proposals@isoc=
pp.org">std-proposals@isocpp.org</a>.<br>
> To view this discussion on the web visit <a href=3D"https://groups.google=
..com/a/isocpp.org/d/msgid/std-proposals/5ad38837.435a620a.8b39e.a4c7%40mx.g=
oogle.com?utm_medium=3Demail&amp;utm_source=3Dfooter">https://groups.google=
..com/a/isocpp.org/d/msgid/std-proposals/5ad38837.435a620a.8b39e.a4c7%40mx.g=
oogle.com</a>.<br>
> <br><!--end of _originalContent --></div></body></html>
>=20
> <p></p>
>=20
> -- <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=
 email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-propo=
sals+unsubscribe@isocpp.org</a>.<br />
> To post to this group, send email to <a href=3D"mailto:std-proposals@isoc=
pp.org">std-proposals@isocpp.org</a>.<br />
> To view this discussion on the web visit <a href=3D"https://groups.google=
..com/a/isocpp.org/d/msgid/std-proposals/20180415172043.5099602.72847.50262%=
40gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/20180415172043.5099602.72847.50262%40=
gmail.com</a>.<br />

--=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/20180415181717.GA2995%40noemi.bahnhof.se.

.


Author: Tony V E <tvaneerd@gmail.com>
Date: Sun, 15 Apr 2018 14:22:18 -0400
Raw View
--0000000000007a52c50569e72f50
Content-Type: text/plain; charset="UTF-8"

On Sun, Apr 15, 2018 at 2:17 PM, Magnus Fromreide <magfr@lysator.liu.se>
wrote:

> But then, what would the result of a lambda with attribute name foo and a
> named entity whose name get mangled to foo be? According to the standard a
> name clash is forbidden, right?
>
>

I would expect compilers to do something smart.  Like mangle the lambda to
__lambda_foo_0x1234...
Still guaranteed unique, but put the name near the from where you can see
it.

Regardless, nothing in the language can tell a compiler how to mangle.
My implementation of C++ is a big sheet of graph paper (each square is a
memory cell) and a pencil.  Mangling doesn't exist in that implementation.

--
Be seeing you,
Tony

--
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/CAOHCbitpct6Eph7KOOSQLbt6eNhN2V8w33-R%3DOPxvM4OXD_Nvw%40mail.gmail.com.

--0000000000007a52c50569e72f50
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div><div class=3D"gmail_extra"><br><div class=3D"gmai=
l_quote">On Sun, Apr 15, 2018 at 2:17 PM, Magnus Fromreide <span dir=3D"ltr=
">&lt;<a href=3D"mailto:magfr@lysator.liu.se" target=3D"_blank">magfr@lysat=
or.liu.se</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">But then=
, what would the result of a lambda with attribute name foo and a<br>
named entity whose name get mangled to foo be? According to the standard a =
<br>
name clash is forbidden, right?=C2=A0
<br clear=3D"all"><br></blockquote></div><br><br></div><div class=3D"gmail_=
extra">I would expect compilers to do something smart.=C2=A0 Like mangle th=
e lambda to __lambda_foo_0x1234...<br></div><div class=3D"gmail_extra">Stil=
l guaranteed unique, but put the name near the from where you can see it.<b=
r><br></div><div class=3D"gmail_extra">Regardless, nothing in the language =
can tell a compiler how to mangle.<br></div><div class=3D"gmail_extra">My i=
mplementation of C++ is a big sheet of graph paper (each square is a memory=
 cell) and a pencil.=C2=A0 Mangling doesn&#39;t exist in that implementatio=
n.<br></div><div class=3D"gmail_extra"><br>-- <br><div class=3D"gmail_signa=
ture" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div>Be seeing yo=
u,<br></div>Tony<br></div></div>
</div></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/CAOHCbitpct6Eph7KOOSQLbt6eNhN2V8w33-R=
%3DOPxvM4OXD_Nvw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOHCbitpct6Eph=
7KOOSQLbt6eNhN2V8w33-R%3DOPxvM4OXD_Nvw%40mail.gmail.com</a>.<br />

--0000000000007a52c50569e72f50--

.


Author: Richard Smith <richard@metafoo.co.uk>
Date: Sun, 15 Apr 2018 16:49:30 -0700
Raw View
--000000000000e1894e0569ebc2f6
Content-Type: text/plain; charset="UTF-8"

On 15 April 2018 at 00:28, Ritwik Das <ritwik.sami1990@gmail.com> wrote:

> Problem:
> The fact that lambda functions are by design unnamed means that the
> compiler has to assign names which show up in the call stack while
> debugging and also in dumps etc. This makes things especially difficult for
> automated tools which categorize dumps based on the call stack because the
> compiler assigned lambda names tend to change over time. Some specific
> problems which occur because of the compiler assigning random names to
> lambda functions are cited below:
>
> *Example 1:*
> *Sample code:*
> template<typename T>
> int func(T&& lambda)
> {
> lambda();
> }
>
> int main()
> {
> func([]() {std::cout << "Hello!"; });
> return 0;
> }
>
> *Compiler Error:*
> 1>lambda.cpp
> 1>\lambda.cpp(11): error C4716: 'func<<
> *lambda_4653923a58ae9d647caab6ef4f61a443*> >': must return a value
>
> Errors like this are hard to track because the error message does not
> really identify the source of the problem.
>

Well...

 * This is not an error. MSVC is wrong to reject this code.

 * The diagnosed issue is independent of the template argument, and so that
diagnostic *is* sufficient to identify it (in this case).

 * The bad naming of the template argument is an MSVC
quality-of-implementation bug, and should be reported to Microsoft, not
here. GCC does somewhat better (calling the lambda "main()::<lambda()>");
Clang also tells you where the lambda was written (calling it "(lambda at
<source>:11:7)"). EDG doesn't give any useful information about the
location of the lambda, but at least doesn't include a nonsense suffix (it
calls it "lambda []()->void"). The C++ standard does not constrain vendors
to produce any particular names in their diagnostics, so this is out of
scope for this forum (unless you want to change that, which would be a
*much* larger change than what I think you're proposing here).

*Example 2:*
> > ClassA::frame6 C++
>   ClassA::frame4::*__l62::<lambda>* C++
>   ClassB::frame3<lambda>(void) > C++
>   ClassA::frame2 C++
>   ClassA::frame1 C++
>
> In the above call stack, the lambda function is referred to as "__l62"
> which neither is very useful nor does this stay invariant over time as more
> lambdas are added to the codebase (it is not even clear how this name is
> chosen by the compiler).
>

Again this is an implementation-specific issue. For example, GCC and its
ABI library produce a mangling for the lambda call operator in your
original example that demangles to "main::{lambda()#1}::operator()()
const", which seems very readable and comprehensible to me. But in any case
this is not covered by the C++ language standard. Talk to your vendor if
you want to see this improved.


> Proposal:
> If there is a way for optionally annotating lambda functions with the
> declaration, the compiler can use this to produce lambda names more
> consistently. e.g. The strawman syntax can be something like: "[=]
> *mylambda1*() {...}". This might seem counter-intuitive since lambdas are
> defined to be *anonymous* functions, adding an optional annotation to the
> lambda does not really take away the benefits of using lambdas over
> functions but rather makes it more powerful.
>
> P.S.:
> Apologies if I missed proposals which addresses the above problem.
>
> --
> 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/5225897d-fa81-4137-
> 928d-f97fcb4f2efe%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>

--
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/CAOfiQqk2kqWRiTXSKgMrCfbqEaQjFayoBMKxrDS4kR%3DYc4zeoA%40mail.gmail.com.

--000000000000e1894e0569ebc2f6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On 1=
5 April 2018 at 00:28, Ritwik Das <span dir=3D"ltr">&lt;<a href=3D"mailto:r=
itwik.sami1990@gmail.com" target=3D"_blank">ritwik.sami1990@gmail.com</a>&g=
t;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div =
dir=3D"ltr"><font size=3D"4">Problem:</font><div>The fact that lambda funct=
ions are by design unnamed means that the compiler has to assign names whic=
h show up in the call stack while debugging and also in dumps etc. This mak=
es things especially difficult for automated tools which categorize dumps b=
ased on the call stack because the compiler assigned lambda names tend to c=
hange over time. Some specific problems which occur because of the compiler=
 assigning random names to lambda functions are cited below:</div><div><br>=
</div><div><b>Example 1:</b></div><div><u>Sample code:</u></div><div><div>t=
emplate&lt;typename T&gt;</div><div>int func(T&amp;&amp; lambda)</div><div>=
{</div><div><span style=3D"white-space:pre-wrap"> </span>lambda();</div><di=
v>}</div><div><br></div><div>int main()</div><div>{</div><div><span style=
=3D"white-space:pre-wrap"> </span>func([]() {std::cout &lt;&lt; &quot;Hello=
!&quot;; });</div><div><span style=3D"white-space:pre-wrap"> </span>return =
0;</div><div>}</div></div><div><br></div><div><u>Compiler Error:</u></div><=
div><div>1&gt;lambda.cpp</div><div>1&gt;\lambda.cpp(11): error C4716: &#39;=
func&lt;&lt;<b>lambda_<wbr>4653923a58ae9d647caab6ef4f61a4<wbr>43</b>&gt; &g=
t;&#39;: must return a value</div></div><div><br></div><div>Errors like thi=
s are hard to track because the error message does not really identify the =
source of the problem.</div></div></blockquote><div><br></div><div>Well...<=
/div><div><br></div><div>=C2=A0* This is not an error. MSVC is wrong to rej=
ect this code.</div><div><br></div><div>=C2=A0* The diagnosed issue is inde=
pendent of the template argument, and so that diagnostic *is* sufficient to=
 identify it (in this case).</div><div><br></div><div>=C2=A0* The bad namin=
g of the template argument is an MSVC quality-of-implementation bug, and sh=
ould be reported to Microsoft, not here. GCC does somewhat better (calling =
the lambda &quot;main()::&lt;lambda()&gt;&quot;); Clang also tells you wher=
e the lambda was written (calling it &quot;(lambda at &lt;source&gt;:11:7)&=
quot;). EDG doesn&#39;t give any useful information about the location of t=
he lambda, but at least doesn&#39;t include a nonsense suffix (it calls it =
&quot;lambda []()-&gt;void&quot;). The C++ standard does not constrain vend=
ors to produce any particular names in their diagnostics, so this is out of=
 scope for this forum (unless you want to change that, which would be a *mu=
ch* larger change than what I think you&#39;re proposing here).</div><div><=
br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"=
><div><b>Example 2:</b></div><div><div>&gt;<span style=3D"white-space:pre-w=
rap"> </span>ClassA::frame6<span style=3D"white-space:pre-wrap"> </span>C++=
</div><div>=C2=A0<span style=3D"white-space:pre-wrap"> </span>ClassA::frame=
4::<b>__l62::&lt;<wbr>lambda&gt;</b><span style=3D"white-space:pre-wrap"> <=
/span>C++</div><div>=C2=A0<span style=3D"white-space:pre-wrap"> </span>Clas=
sB::frame3&lt;lambda&gt;(void) &gt;<span style=3D"white-space:pre-wrap"> </=
span>C++</div><div>=C2=A0<span style=3D"white-space:pre-wrap"> </span>Class=
A::frame2<span style=3D"white-space:pre-wrap"> </span>C++</div><div>=C2=A0<=
span style=3D"white-space:pre-wrap"> </span>ClassA::frame1<span style=3D"wh=
ite-space:pre-wrap"> </span>C++</div></div><div><br></div><div>In the above=
 call stack, the lambda function is referred to as &quot;__l62&quot; which =
neither is very useful nor does this stay invariant over time as more lambd=
as are added to the codebase (it is not even clear how this name is chosen =
by the compiler).</div></div></blockquote><div><br></div><div>Again this is=
 an implementation-specific issue. For example, GCC and its ABI library pro=
duce a mangling for the lambda call operator in your original example that =
demangles to &quot;main::{lambda()#1}::operator()() const&quot;, which seem=
s very readable and comprehensible to me. But in any case this is not cover=
ed by the C++ language standard. Talk to your vendor if you want to see thi=
s improved.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex"><div dir=3D"ltr"><div><font size=3D"4">Proposal:</font></div><di=
v>If there is a way for optionally annotating lambda functions with the dec=
laration, the compiler can use this to produce lambda names more consistent=
ly. e.g. The strawman syntax can be something like: &quot;[=3D] <b>mylambda=
1</b>() {...}&quot;. This might seem counter-intuitive since lambdas are de=
fined to be <i>anonymous</i> functions, adding an optional annotation to th=
e lambda does not really take away the benefits of using lambdas over funct=
ions but rather makes it more powerful.</div><div><br></div><div>P.S.:</div=
><div>Apologies if I missed proposals which addresses the above problem.</d=
iv></div><span class=3D"gmail-HOEnZb"><font color=3D"#888888">

<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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">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/5225897d-fa81-4137-928d-f97fcb4f2efe%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/5225=
897d-fa81-4137-<wbr>928d-f97fcb4f2efe%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div><br></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/CAOfiQqk2kqWRiTXSKgMrCfbqEaQjFayoBMKx=
rDS4kR%3DYc4zeoA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOfiQqk2kqWRiT=
XSKgMrCfbqEaQjFayoBMKxrDS4kR%3DYc4zeoA%40mail.gmail.com</a>.<br />

--000000000000e1894e0569ebc2f6--

.


Author: Richard Smith <richard@metafoo.co.uk>
Date: Sun, 15 Apr 2018 16:53:22 -0700
Raw View
--000000000000a929060569ebd019
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On 15 April 2018 at 10:19, Nicolas Lesser <blitzrakete@gmail.com> wrote:

> Okay, makes sense. Then you might want to look at P0839
> <http://wg21.link/p0839>, which proposes exactly the same thing. In that
> case, you're right: Attributes are the wrong feature to use for your
> proposal.
>
> Note: That paper was never discussed in Albuquerque, and it never came
> back. Maybe ask the author?
>

Hi :)

I requested that discussion of P0839 be deferred until P0847 was discussed
in Evolution, because P0847 provides an alternative and more general
solution to the problem I was trying to solve with P0839. Sadly we didn't
have time to discuss P0847 at Jacksonville, but hopefully both papers will
be discussed at Rapperswil.


> On Sun, Apr 15, 2018 at 7:13 PM, Ritwik Das <ritwik.sami1990@gmail.com>
> wrote:
>
>> Isn=E2=80=99t that the same behavior when someone changes regular functi=
on names,
>> symbols for which depend on the given names based on some predefined
>> mangling rules. I don=E2=80=99t want this to be any different for lambda=
s and that
>> is what this proposal is about=E2=80=A6
>>
>>
>>
>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=3D550986> for
>> Windows 10
>>
>>
>>
>> *From: *Nicolas Lesser <blitzrakete@gmail.com>
>> *Sent: *Sunday, April 15, 2018 9:19 AM
>>
>> *To: *std-proposals@isocpp.org
>> *Subject: *Re: [std-proposals] Lambda annotations
>>
>>
>>
>> I don't think that those annotations should change the actual symbol
>> generated, because that would mean that you could break the ABI by simpl=
y
>> changing the name of the lambda, and conflicts can happen quite quickly.=
 I
>> would rather see those names used as informal lambda name for debugging =
and
>> error reporting messages.
>>
>>
>>
>> Also, this was just an idea. Currently there is no way to do that, so
>> it's just normal that in your case they don't do anything.
>>
>>
>>
>> On Sun, Apr 15, 2018 at 6:14 PM, Ritwik Das <ritwik.sami1990@gmail.com>
>> wrote:
>>
>> Standard attributes/implementation specific attributes do not help much
>> in this case but new attributes do not affect the compiler generated nam=
es
>> I would want symbols to be generated based on the given names. I tried
>> something like this but the names are random regardless. What am I missi=
ng?
>>
>>
>>
>> #include <iostream>
>>
>>
>>
>> template<typename T>
>>
>> void func(T&& lambda)
>>
>> {
>>
>>     lambda();
>>
>> }
>>
>>
>>
>> int main()
>>
>> {
>>
>>     func([]()[[cats::meow]] {std::cout << "Hello!"; });
>>
>>     func([]() {std::cout << "world!"; });
>>
>>     return 0;
>>
>> }
>>
>>
>>
>>
>>
>>
>>
>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=3D550986> for
>> Windows 10
>>
>>
>>
>> *From: *Nicolas Lesser <blitzrakete@gmail.com>
>> *Sent: *Sunday, April 15, 2018 8:50 AM
>>
>>
>> *To: *std-proposals@isocpp.org
>> *Subject: *Re: [std-proposals] Lambda annotations
>>
>>
>>
>> Well, you could use either a new attribute or an implementation-defined
>> attribute to give the lambda a name for debugging/error reporting purpos=
es.
>>
>>
>>
>> On Sun, Apr 15, 2018 at 5:28 PM, Ritwik Das <ritwik.sami1990@gmail.com>
>> wrote:
>>
>> But I am still confused how attributes can solve the problems mentioned
>> below?
>>
>>
>>
>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=3D550986> for
>> Windows 10
>>
>>
>>
>> *From: *Nicolas Lesser <blitzrakete@gmail.com>
>> *Sent: *Sunday, April 15, 2018 1:03 AM
>> *To: *std-proposals@isocpp.org
>> *Subject: *Re: [std-proposals] Lambda annotations
>>
>>
>>
>> There was a proposal or idea once to name lambdas to be able to name the
>> lambda inside the lambda, and the syntax exactly matches what you propos=
e.
>>
>>
>>
>> Currently you can use an attribute :).
>>
>>
>>
>> On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das <ritwik.sami1990@gmail.com>
>> wrote:
>>
>> Problem:
>>
>> The fact that lambda functions are by design unnamed means that the
>> compiler has to assign names which show up in the call stack while
>> debugging and also in dumps etc. This makes things especially difficult =
for
>> automated tools which categorize dumps based on the call stack because t=
he
>> compiler assigned lambda names tend to change over time. Some specific
>> problems which occur because of the compiler assigning random names to
>> lambda functions are cited below:
>>
>>
>>
>> *Example 1:*
>>
>> *Sample code:*
>>
>> template<typename T>
>>
>> int func(T&& lambda)
>>
>> {
>>
>> lambda();
>>
>> }
>>
>>
>>
>> int main()
>>
>> {
>>
>> func([]() {std::cout << "Hello!"; });
>>
>> return 0;
>>
>> }
>>
>>
>>
>> *Compiler Error:*
>>
>> 1>lambda.cpp
>>
>> 1>\lambda.cpp(11): error C4716: 'func<<
>> *lambda_4653923a58ae9d647caab6ef4f61a443*> >': must return a value
>>
>>
>>
>> Errors like this are hard to track because the error message does not
>> really identify the source of the problem.
>>
>>
>>
>> *Example 2:*
>>
>> > ClassA::frame6 C++
>>
>>   ClassA::frame4::*__l62::<lambda>* C++
>>
>>   ClassB::frame3<lambda>(void) > C++
>>
>>   ClassA::frame2 C++
>>
>>   ClassA::frame1 C++
>>
>>
>>
>> In the above call stack, the lambda function is referred to as "__l62"
>> which neither is very useful nor does this stay invariant over time as m=
ore
>> lambdas are added to the codebase (it is not even clear how this name is
>> chosen by the compiler).
>>
>>
>>
>> Proposal:
>>
>> If there is a way for optionally annotating lambda functions with the
>> declaration, the compiler can use this to produce lambda names more
>> consistently. e.g. The strawman syntax can be something like: "[=3D]
>> *mylambda1*() {...}". This might seem counter-intuitive since lambdas
>> are defined to be *anonymous* functions, adding an optional annotation
>> to the lambda does not really take away the benefits of using lambdas ov=
er
>> functions but rather makes it more powerful.
>>
>>
>>
>> P.S.:
>>
>> Apologies if I missed proposals which addresses the above problem.
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/is
>> ocpp.org/d/msgid/std-proposals/5225897d-fa81-4137-928d-
>> f97fcb4f2efe%40isocpp.org
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5225897d-f=
a81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoo=
ter>
>> .
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/is
>> ocpp.org/d/msgid/std-proposals/CALmDwq2sdDK05--85eo%
>> 3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq2sd=
DK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVgMw%40mail.gmail.com?utm_medium=
=3Demail&utm_source=3Dfooter>
>> .
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/is
>> ocpp.org/d/msgid/std-proposals/5ad36f81.c614620a.ddf08.2250%
>> 40mx.google.com
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad36f81.c=
614620a.ddf08.2250%40mx.google.com?utm_medium=3Demail&utm_source=3Dfooter>
>> .
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/is
>> ocpp.org/d/msgid/std-proposals/CALmDwq1oGuP3Bj3AfHVnJK2eozRW
>> ZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq1oG=
uP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com?utm_medium=
=3Demail&utm_source=3Dfooter>
>> .
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/is
>> ocpp.org/d/msgid/std-proposals/5ad37a5f.d164650a.b857a.760b%
>> 40mx.google.com
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad37a5f.d=
164650a.b857a.760b%40mx.google.com?utm_medium=3Demail&utm_source=3Dfooter>
>> .
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/is
>> ocpp.org/d/msgid/std-proposals/CALmDwq0tZUjRMpD7i_pwKS_G2%
>> 2BgvwCH5T%2BaJEypujVuEx68%3DNQ%40mail.gmail.com
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq0tZ=
UjRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68%3DNQ%40mail.gmail.com?utm_medium=
=3Demail&utm_source=3Dfooter>
>> .
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/is
>> ocpp.org/d/msgid/std-proposals/5ad38837.435a620a.8b39e.a4c7%
>> 40mx.google.com
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad38837.4=
35a620a.8b39e.a4c7%40mx.google.com?utm_medium=3Demail&utm_source=3Dfooter>
>> .
>>
>
> --
> 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/CALmDwq3%2BGLacfpvzPE%2BfW_cYrUnw88%
> 3Dmg40OBGEniHw287%2Bz2Q%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq3%2B=
GLacfpvzPE%2BfW_cYrUnw88%3Dmg40OBGEniHw287%2Bz2Q%40mail.gmail.com?utm_mediu=
m=3Demail&utm_source=3Dfooter>
> .
>

--=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/CAOfiQqnFcFDcbWw07JoYXZ98de5ap1UEXt9BgMgAtWG_oQa=
5mQ%40mail.gmail.com.

--000000000000a929060569ebd019
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On 1=
5 April 2018 at 10:19, Nicolas Lesser <span dir=3D"ltr">&lt;<a href=3D"mail=
to:blitzrakete@gmail.com" target=3D"_blank">blitzrakete@gmail.com</a>&gt;</=
span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e=
x;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Okay, makes=
 sense. Then you might want to look at=C2=A0<a href=3D"http://wg21.link/p08=
39" target=3D"_blank">P0839</a>, which proposes exactly the same thing. In =
that case, you&#39;re right: Attributes are the wrong feature to use for yo=
ur proposal.<div><br></div><div>Note: That paper was never discussed in Alb=
uquerque, and it never came back. Maybe ask the author?=C2=A0</div></div></=
blockquote><div><br></div><div>Hi :)</div><div><br></div><div>I requested t=
hat discussion of P0839 be deferred until P0847 was discussed in Evolution,=
 because P0847 provides an alternative and more general solution to the pro=
blem I was trying to solve with P0839. Sadly we didn&#39;t have time to dis=
cuss P0847 at Jacksonville, but hopefully both papers will be discussed at =
Rapperswil.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><di=
v class=3D"h5"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On Sun=
, Apr 15, 2018 at 7:13 PM, Ritwik Das <span dir=3D"ltr">&lt;<a href=3D"mail=
to:ritwik.sami1990@gmail.com" target=3D"_blank">ritwik.sami1990@gmail.com</=
a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0=
 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang=3D"EN-US" =
link=3D"blue" vlink=3D"#954F72"><div class=3D"m_8228190266332853497m_838411=
8837586847347WordSection1"><p class=3D"MsoNormal">Isn=E2=80=99t that the sa=
me behavior when someone changes regular function names, symbols for which =
depend on the given names based on some predefined mangling rules. I don=E2=
=80=99t want this to be any different for lambdas and that is what this pro=
posal is about=E2=80=A6</p><span><p class=3D"MsoNormal"><u></u>=C2=A0<u></u=
></p><p class=3D"MsoNormal">Sent from <a href=3D"https://go.microsoft.com/f=
wlink/?LinkId=3D550986" target=3D"_blank">Mail</a> for Windows 10</p><p cla=
ss=3D"MsoNormal"><u></u>=C2=A0<u></u></p></span><div style=3D"border:none;b=
order-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class=3D"MsoNor=
mal" style=3D"border:none;padding:0in"><b>From: </b><a href=3D"mailto:blitz=
rakete@gmail.com" target=3D"_blank">Nicolas Lesser</a><br><b>Sent: </b>Sund=
ay, April 15, 2018 9:19 AM</p><div><div class=3D"m_8228190266332853497h5"><=
br><b>To: </b><a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank"=
>std-proposals@isocpp.org</a><br><b>Subject: </b>Re: [std-proposals] Lambda=
 annotations</div></div><p></p></div><div><div class=3D"m_82281902663328534=
97h5"><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><div><p class=3D"MsoNo=
rmal">I don&#39;t think that those annotations should change the actual sym=
bol generated, because that would mean that you could break the ABI by simp=
ly changing the name of the lambda, and conflicts can happen quite quickly.=
 I would rather see those names used as informal lambda name for debugging =
and error reporting messages.</p><div><p class=3D"MsoNormal"><u></u>=C2=A0<=
u></u></p></div><div><p class=3D"MsoNormal">Also, this was just an idea. Cu=
rrently there is no way to do that, so it&#39;s just normal that in your ca=
se they don&#39;t do anything.</p></div></div><div><p class=3D"MsoNormal"><=
u></u>=C2=A0<u></u></p><div><p class=3D"MsoNormal">On Sun, Apr 15, 2018 at =
6:14 PM, Ritwik Das &lt;<a href=3D"mailto:ritwik.sami1990@gmail.com" target=
=3D"_blank">ritwik.sami1990@gmail.com</a>&gt; wrote:</p><blockquote style=
=3D"border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;m=
argin-left:4.8pt;margin-right:0in"><div><div><p class=3D"MsoNormal">Standar=
d attributes/implementation specific attributes do not help much in this ca=
se but new attributes do not affect the compiler generated names I would wa=
nt symbols to be generated based on the given names. I tried something like=
 this but the names are random regardless. What am I missing?</p><p class=
=3D"MsoNormal">=C2=A0</p><div><div><div><p class=3D"MsoNormal"><span style=
=3D"color:blue">#include</span><span style=3D"color:black"> &lt;iostream&gt=
;</span></p></div><p class=3D"MsoNormal">=C2=A0</p><div><p class=3D"MsoNorm=
al"><span style=3D"color:blue">template</span><span style=3D"color:black">&=
lt;</span><span style=3D"color:blue">typename</span><span style=3D"color:bl=
ack"> T&gt;</span></p></div><div><p class=3D"MsoNormal"><span style=3D"colo=
r:blue">void</span><span style=3D"color:black"> func(T&amp;&amp; lambda)</s=
pan></p></div><div><p class=3D"MsoNormal"><span style=3D"color:black">{</sp=
an></p></div><div><p class=3D"MsoNormal"><span style=3D"color:black">=C2=A0=
=C2=A0=C2=A0=C2=A0lambda();</span></p></div><div><p class=3D"MsoNormal"><sp=
an style=3D"color:black">}</span></p></div><p class=3D"MsoNormal">=C2=A0</p=
><div><p class=3D"MsoNormal"><span style=3D"color:blue">int</span><span sty=
le=3D"color:black"> main()</span></p></div><div><p class=3D"MsoNormal"><spa=
n style=3D"color:black">{</span></p></div><div><p class=3D"MsoNormal"><span=
 style=3D"color:black">=C2=A0=C2=A0=C2=A0=C2=A0func([]()</span><span style=
=3D"color:gray">[[cats::meow]]</span><span style=3D"color:black"> {std::cou=
t &lt;&lt; </span><span style=3D"color:#a31515">&quot;Hello!&quot;</span><s=
pan style=3D"color:black">; });</span></p></div><div><p class=3D"MsoNormal"=
><span style=3D"color:black">=C2=A0=C2=A0=C2=A0=C2=A0func([]() {std::cout &=
lt;&lt; </span><span style=3D"color:#a31515">&quot;world!&quot;</span><span=
 style=3D"color:black">; });</span></p></div><div><p class=3D"MsoNormal"><s=
pan style=3D"color:black">=C2=A0=C2=A0=C2=A0=C2=A0</span><span style=3D"col=
or:blue">return</span><span style=3D"color:black"> </span><span style=3D"co=
lor:#09885a">0</span><span style=3D"color:black">;</span></p></div><div><p =
class=3D"MsoNormal"><span style=3D"color:black">}</span></p></div><p class=
=3D"MsoNormal">=C2=A0</p></div></div><p class=3D"MsoNormal">=C2=A0</p><p cl=
ass=3D"MsoNormal">=C2=A0</p><p class=3D"MsoNormal">Sent from <a href=3D"htt=
ps://go.microsoft.com/fwlink/?LinkId=3D550986" target=3D"_blank">Mail</a> f=
or Windows 10</p><p class=3D"MsoNormal">=C2=A0</p><div style=3D"border:none=
;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class=3D"MsoN=
ormal"><b>From: </b><a href=3D"mailto:blitzrakete@gmail.com" target=3D"_bla=
nk">Nicolas Lesser</a><br><b>Sent: </b>Sunday, April 15, 2018 8:50 AM</p><d=
iv><div><p class=3D"MsoNormal"><br><b>To: </b><a href=3D"mailto:std-proposa=
ls@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a><br><b>Subject=
: </b>Re: [std-proposals] Lambda annotations</p></div></div></div><div><div=
><p class=3D"MsoNormal">=C2=A0</p><div><p class=3D"MsoNormal">Well, you cou=
ld use either a new attribute or an implementation-defined attribute to giv=
e the lambda a name for debugging/error reporting purposes.</p></div><div><=
p class=3D"MsoNormal">=C2=A0</p><div><p class=3D"MsoNormal">On Sun, Apr 15,=
 2018 at 5:28 PM, Ritwik Das &lt;<a href=3D"mailto:ritwik.sami1990@gmail.co=
m" target=3D"_blank">ritwik.sami1990@gmail.com</a>&gt; wrote:</p><blockquot=
e style=3D"border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in =
6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0=
pt"><div><div><p class=3D"MsoNormal">But I am still confused how attributes=
 can solve the problems mentioned below?</p><p class=3D"MsoNormal">=C2=A0</=
p><p class=3D"MsoNormal">Sent from <a href=3D"https://go.microsoft.com/fwli=
nk/?LinkId=3D550986" target=3D"_blank">Mail</a> for Windows 10</p><p class=
=3D"MsoNormal">=C2=A0</p><div style=3D"border:none;border-top:solid #e1e1e1=
 1.0pt;padding:3.0pt 0in 0in 0in"><p class=3D"MsoNormal"><b>From: </b><a hr=
ef=3D"mailto:blitzrakete@gmail.com" target=3D"_blank">Nicolas Lesser</a><br=
><b>Sent: </b>Sunday, April 15, 2018 1:03 AM<br><b>To: </b><a href=3D"mailt=
o:std-proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a><=
br><b>Subject: </b>Re: [std-proposals] Lambda annotations</p></div><div><di=
v><p class=3D"MsoNormal">=C2=A0</p><div><p class=3D"MsoNormal">There was a =
proposal or idea once to name lambdas to be able to name the lambda inside =
the lambda, and the syntax exactly matches what you propose.</p><div><p cla=
ss=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNormal">Currently you =
can use an attribute :).</p></div></div><div><p class=3D"MsoNormal">=C2=A0<=
/p><div><p class=3D"MsoNormal">On Sun, Apr 15, 2018 at 9:28 AM, Ritwik Das =
&lt;<a href=3D"mailto:ritwik.sami1990@gmail.com" target=3D"_blank">ritwik.s=
ami1990@gmail.com</a>&gt; wrote:</p><blockquote style=3D"border:none;border=
-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margi=
n-top:5.0pt;margin-right:0in;margin-bottom:5.0pt"><div><p class=3D"MsoNorma=
l"><span style=3D"font-size:13.5pt">Problem:</span></p><div><p class=3D"Mso=
Normal">The fact that lambda functions are by design unnamed means that the=
 compiler has to assign names which show up in the call stack while debuggi=
ng and also in dumps etc. This makes things especially difficult for automa=
ted tools which categorize dumps based on the call stack because the compil=
er assigned lambda names tend to change over time. Some specific problems w=
hich occur because of the compiler assigning random names to lambda functio=
ns are cited below:</p></div><div><p class=3D"MsoNormal">=C2=A0</p></div><d=
iv><p class=3D"MsoNormal"><b>Example 1:</b></p></div><div><p class=3D"MsoNo=
rmal"><u>Sample code:</u></p></div><div><div><p class=3D"MsoNormal">templat=
e&lt;typename T&gt;</p></div><div><p class=3D"MsoNormal">int func(T&amp;&am=
p; lambda)</p></div><div><p class=3D"MsoNormal">{</p></div><div><p class=3D=
"MsoNormal">lambda();</p></div><div><p class=3D"MsoNormal">}</p></div><div>=
<p class=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNormal">int main=
()</p></div><div><p class=3D"MsoNormal">{</p></div><div><p class=3D"MsoNorm=
al">func([]() {std::cout &lt;&lt; &quot;Hello!&quot;; });</p></div><div><p =
class=3D"MsoNormal">return 0;</p></div><div><p class=3D"MsoNormal">}</p></d=
iv></div><div><p class=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNo=
rmal"><u>Compiler Error:</u></p></div><div><div><p class=3D"MsoNormal">1&gt=
;lambda.cpp</p></div><div><p class=3D"MsoNormal">1&gt;\lambda.cpp(11): erro=
r C4716: &#39;func&lt;&lt;<b>lambda_4653923a58ae9d64<wbr>7caab6ef4f61a443</=
b>&gt; &gt;&#39;: must return a value</p></div></div><div><p class=3D"MsoNo=
rmal">=C2=A0</p></div><div><p class=3D"MsoNormal">Errors like this are hard=
 to track because the error message does not really identify the source of =
the problem.</p></div><div><p class=3D"MsoNormal">=C2=A0</p></div><div><p c=
lass=3D"MsoNormal"><b>Example 2:</b></p></div><div><div><p class=3D"MsoNorm=
al">&gt; ClassA::frame6 C++</p></div><div><p class=3D"MsoNormal">=C2=A0 Cla=
ssA::frame4::<b>__l62::&lt;lambda<wbr>&gt;</b> C++</p></div><div><p class=
=3D"MsoNormal">=C2=A0 ClassB::frame3&lt;lambda&gt;(void) &gt; C++</p></div>=
<div><p class=3D"MsoNormal">=C2=A0 ClassA::frame2 C++</p></div><div><p clas=
s=3D"MsoNormal">=C2=A0 ClassA::frame1 C++</p></div></div><div><p class=3D"M=
soNormal">=C2=A0</p></div><div><p class=3D"MsoNormal">In the above call sta=
ck, the lambda function is referred to as &quot;__l62&quot; which neither i=
s very useful nor does this stay invariant over time as more lambdas are ad=
ded to the codebase (it is not even clear how this name is chosen by the co=
mpiler).</p></div><div><p class=3D"MsoNormal">=C2=A0</p></div><div><p class=
=3D"MsoNormal"><span style=3D"font-size:13.5pt">Proposal:</span></p></div><=
div><p class=3D"MsoNormal">If there is a way for optionally annotating lamb=
da functions with the declaration, the compiler can use this to produce lam=
bda names more consistently. e.g. The strawman syntax can be something like=
: &quot;[=3D] <b>mylambda1</b>() {...}&quot;. This might seem counter-intui=
tive since lambdas are defined to be <i>anonymous</i> functions, adding an =
optional annotation to the lambda does not really take away the benefits of=
 using lambdas over functions but rather makes it more powerful.</p></div><=
div><p class=3D"MsoNormal">=C2=A0</p></div><div><p class=3D"MsoNormal">P.S.=
:</p></div><div><p class=3D"MsoNormal">Apologies if I missed proposals whic=
h addresses the above problem.</p></div></div><p class=3D"MsoNormal"><span =
class=3D"m_8228190266332853497m_8384118837586847347m6031191767155126304m419=
5605197699100460hoenzb"><span style=3D"color:#888888">-- </span></span><spa=
n style=3D"color:#888888"><br><span class=3D"m_8228190266332853497m_8384118=
837586847347m6031191767155126304m4195605197699100460hoenzb">You received th=
is message because you are subscribed to the Google Groups &quot;ISO C++ St=
andard - Future Proposals&quot; group.</span><br><span class=3D"m_822819026=
6332853497m_8384118837586847347m6031191767155126304m4195605197699100460hoen=
zb">To unsubscribe from this group and stop receiving emails from it, send =
an email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=
=3D"_blank">std-proposals+unsubscribe@isoc<wbr>pp.org</a>.</span><br><span =
class=3D"m_8228190266332853497m_8384118837586847347m6031191767155126304m419=
5605197699100460hoenzb">To post to this group, send email to <a href=3D"mai=
lto:std-proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a=
>.</span><br><span class=3D"m_8228190266332853497m_8384118837586847347m6031=
191767155126304m4195605197699100460hoenzb">To view this discussion on the w=
eb visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-prop=
osals/5225897d-fa81-4137-928d-f97fcb4f2efe%40isocpp.org?utm_medium=3Demail&=
amp;utm_source=3Dfooter" target=3D"_blank">https://groups.google.com/a/is<w=
br>ocpp.org/d/msgid/std-proposals<wbr>/5225897d-fa81-4137-928d-<wbr>f97fcb4=
f2efe%40isocpp.org</a>.</span></span></p></blockquote></div><p class=3D"Mso=
Normal">=C2=A0</p></div></div></div><div><div><p class=3D"MsoNormal">-- <br=
>You received this message because you are subscribed to the Google Groups =
&quot;ISO C++ Standard - Future Proposals&quot; group.<br>To unsubscribe fr=
om this group and stop receiving emails from it, send an email to <a href=
=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank">std-prop=
osals+unsubscribe@isoc<wbr>pp.org</a>.<br>To post to this group, send email=
 to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-propo=
sals@isocpp.org</a>.</p></div></div><p class=3D"MsoNormal">To view this dis=
cussion on the web visit <a href=3D"https://groups.google.com/a/isocpp.org/=
d/msgid/std-proposals/CALmDwq2sdDK05--85eo%3DeNRceVjqRA1-W7DLVof0h%2BJ0jjVg=
Mw%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_=
blank">https://groups.google.com/a/is<wbr>ocpp.org/d/msgid/std-proposals<wb=
r>/CALmDwq2sdDK05--85eo%<wbr>3DeNRceVjqRA1-W7DLVof0h%2BJ0jj<wbr>VgMw%40mail=
..gmail.com</a>.</p><p class=3D"MsoNormal">=C2=A0</p></div></div><p class=3D=
"MsoNormal">-- <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 =
email to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"=
_blank">std-proposals+unsubscribe@isoc<wbr>pp.org</a>.<br>To post to this g=
roup, send email to <a href=3D"mailto:std-proposals@isocpp.org" target=3D"_=
blank">std-proposals@isocpp.org</a>.<br>To view this discussion on the web =
visit <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposa=
ls/5ad36f81.c614620a.ddf08.2250%40mx.google.com?utm_medium=3Demail&amp;utm_=
source=3Dfooter" target=3D"_blank">https://groups.google.com/a/is<wbr>ocpp.=
org/d/msgid/std-proposals<wbr>/5ad36f81.c614620a.ddf08.2250%<wbr>40mx.googl=
e.com</a>.</p></blockquote></div><p class=3D"MsoNormal">=C2=A0</p></div></d=
iv></div><div><div><p class=3D"MsoNormal">-- <br>You received this message =
because you are subscribed to the Google Groups &quot;ISO C++ Standard - Fu=
ture Proposals&quot; group.<br>To unsubscribe from this group and stop rece=
iving emails from it, send an email to <a href=3D"mailto:std-proposals+unsu=
bscribe@isocpp.org" target=3D"_blank">std-proposals+unsubscribe@isoc<wbr>pp=
..org</a>.<br>To post to this group, send email to <a href=3D"mailto:std-pro=
posals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a>.</p></div=
></div><p class=3D"MsoNormal">To view this discussion on the web visit <a h=
ref=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmDwq=
1oGuP3Bj3AfHVnJK2eozRWZZ%3DOjf6AQaQPB%2ByLiz1oJg%40mail.gmail.com?utm_mediu=
m=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">https://groups.google.=
com/a/is<wbr>ocpp.org/d/msgid/std-proposals<wbr>/CALmDwq1oGuP3Bj3AfHVnJK2eo=
zRW<wbr>ZZ%3DOjf6AQaQPB%2ByLiz1oJg%40m<wbr>ail.gmail.com</a>.</p><p class=
=3D"MsoNormal">=C2=A0</p></div></div><p class=3D"MsoNormal">-- <br>You rece=
ived this message because you are subscribed to the Google Groups &quot;ISO=
 C++ Standard - Future Proposals&quot; group.<br>To unsubscribe from this g=
roup and stop receiving emails from it, send an email to <a href=3D"mailto:=
std-proposals+unsubscribe@isocpp.org" target=3D"_blank">std-proposals+unsub=
scribe@isoc<wbr>pp.org</a>.<br>To post to this group, send email to <a href=
=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp=
..org</a>.<br>To view this discussion on the web visit <a href=3D"https://gr=
oups.google.com/a/isocpp.org/d/msgid/std-proposals/5ad37a5f.d164650a.b857a.=
760b%40mx.google.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"=
_blank">https://groups.google.com/a/is<wbr>ocpp.org/d/msgid/std-proposals<w=
br>/5ad37a5f.d164650a.b857a.760b%<wbr>40mx.google.com</a>.</p></blockquote>=
</div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div></div></div><p c=
lass=3D"MsoNormal"></p><div><div class=3D"m_8228190266332853497h5">-- <br>Y=
ou received this message because you are subscribed to the Google Groups &q=
uot;ISO C++ Standard - Future Proposals&quot; group.<br>To unsubscribe from=
 this group and stop receiving emails from it, send an email to <a href=3D"=
mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank">std-proposal=
s+unsubscribe@isoc<wbr>pp.org</a>.<br>To post to this group, send email to =
<a href=3D"mailto:std-proposals@isocpp.org" target=3D"_blank">std-proposals=
@isocpp.org</a>.<br></div></div>To view this discussion on the web visit <a=
 href=3D"https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALmD=
wq0tZUjRMpD7i_pwKS_G2%2BgvwCH5T%2BaJEypujVuEx68%3DNQ%40mail.gmail.com?utm_m=
edium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">https://groups.goo=
gle.com/a/is<wbr>ocpp.org/d/msgid/std-proposals<wbr>/CALmDwq0tZUjRMpD7i_pwK=
S_G2%<wbr>2BgvwCH5T%2BaJEypujVuEx68%<wbr>3DNQ%40mail.gmail.com</a>.<p></p><=
p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div></div><span>

<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" target=3D"_=
blank">std-proposals+unsubscribe@isoc<wbr>pp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/5ad38837.435a620a.8b39e.a4c7%40mx.goo=
gle.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">https=
://groups.google.com/a/is<wbr>ocpp.org/d/msgid/std-proposals<wbr>/5ad38837.=
435a620a.8b39e.a4c7%<wbr>40mx.google.com</a>.<br>
</blockquote></div><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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></div></div>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CALmDwq3%2BGLacfpvzPE%2BfW_cYrUnw88%3=
Dmg40OBGEniHw287%2Bz2Q%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=
=3Dfooter" target=3D"_blank">https://groups.google.com/a/<wbr>isocpp.org/d/=
msgid/std-<wbr>proposals/CALmDwq3%<wbr>2BGLacfpvzPE%2BfW_cYrUnw88%<wbr>3Dmg=
40OBGEniHw287%2Bz2Q%<wbr>40mail.gmail.com</a>.<br>
</blockquote></div><br></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/CAOfiQqnFcFDcbWw07JoYXZ98de5ap1UEXt9B=
gMgAtWG_oQa5mQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOfiQqnFcFDcbWw0=
7JoYXZ98de5ap1UEXt9BgMgAtWG_oQa5mQ%40mail.gmail.com</a>.<br />

--000000000000a929060569ebd019--

.


Author: Dilip Ranganathan <misc.usage@gmail.com>
Date: Mon, 16 Apr 2018 11:10:30 +0000
Raw View
--883d24f639b0b2ff1b0569f545ea
Content-Type: text/plain; charset="UTF-8"

On Sun, Apr 15, 2018, 7:49 PM Richard Smith <richard@metafoo.co.uk> wrote:

>
>
> Well...
>
>  * This is not an error. MSVC is wrong to reject this code.
>

It's a warning. I think OP might have set it up to treat warnings as errors.

--
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/CALEPxftyUdg85FWTZ3WtXerJm_NhikxSuN4%2BgnrFWADSscFGTA%40mail.gmail.com.

--883d24f639b0b2ff1b0569f545ea
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><br><br><div class=3D"gmail_quote" dir=3D"auto"><div dir=
=3D"ltr">On Sun, Apr 15, 2018, 7:49 PM Richard Smith &lt;<a href=3D"mailto:=
richard@metafoo.co.uk">richard@metafoo.co.uk</a>&gt; wrote:<br></div><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc=
 solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_extra"><div c=
lass=3D"gmail_quote"><br><div><br></div><div>Well...</div><div><br></div><d=
iv>=C2=A0* This is not an error. MSVC is wrong to reject this code.</div></=
div></div></div></blockquote></div><div dir=3D"auto"><br></div><div dir=3D"=
auto">It&#39;s a warning. I think OP might have set it up to treat warnings=
 as errors.</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/CALEPxftyUdg85FWTZ3WtXerJm_NhikxSuN4%=
2BgnrFWADSscFGTA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALEPxftyUdg85F=
WTZ3WtXerJm_NhikxSuN4%2BgnrFWADSscFGTA%40mail.gmail.com</a>.<br />

--883d24f639b0b2ff1b0569f545ea--

.