Topic: deferring destruction


Author: Francisco Lopes <francisco.mailing.lists@oblita.com>
Date: Sat, 9 Jul 2016 15:01:53 -0700 (PDT)
Raw View
------=_Part_385_1572831691.1468101713722
Content-Type: multipart/alternative;
 boundary="----=_Part_386_698857760.1468101713723"

------=_Part_386_698857760.1468101713723
Content-Type: text/plain; charset=UTF-8

It has been some years this idea floats in my mind as a nice feature, so
I'd like
to ask you guys whether you also feel it would be helpful as I think so,
it's my first proposal sketch here.

I'd like to suggest a new keyword, *defer*, whose main purpose is to extend
the lifetime of a temporary following it, to the enclosing scope.

Which would help on situations like this

#include <memory>
#include <iostream>

int main() {
    std::shared_ptr<void> at_exit_1(nullptr, [](...){ std::cout << 4; });
    std::cout << 1;

    std::shared_ptr<void> at_exit_2(nullptr, [](...){ std::cout << 3; });
    std::cout << 2;
}

which could be rewritten like:

#include <memory>
#include <iostream>

int main() {
    defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 4; });
    std::cout << 1;

    defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 3; });
    std::cout << 2;
}

without having to care for naming without necessity.

I know such kind of situation happen not only when using that kind of at_exit
trick, but also, this is a feature that couples perfectly to std::lock_guard
or any kind of guard for that matter.

This would also have a strong connection with the scope_exit & unique_resource
proposal.

The keyword is inspired in the defer keyword from the Go programming language.

Actually, I just happened to come here after reviewing some questions on StackOverflow
where I have had participation:

- http://stackoverflow.com/questions/33050620

Regards,
Francisco Lopes

--
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/76395bd2-5288-439a-9002-bd7a950cf32c%40isocpp.org.

------=_Part_386_698857760.1468101713723
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">It has been some years this idea floats in my mind as a ni=
ce feature, so I&#39;d like<br>to ask you guys whether you also feel it wou=
ld be helpful as I think so, it&#39;s my first proposal sketch here.<br><br=
>I&#39;d like to suggest a new keyword, <span style=3D"font-family: courier=
 new,monospace;"><b>defer</b></span>, whose main purpose is to extend<br>th=
e lifetime of a temporary following it, to the enclosing scope.<br><br>Whic=
h would help on situations like this<br><br><pre style=3D"" class=3D"defaul=
t prettyprint prettyprinted"><code><span style=3D"font-family: courier new,=
monospace;"><span class=3D"com">#include</span><span class=3D"pln"> </span>=
<span class=3D"str">&lt;memory&gt;</span><span class=3D"pln"></span><span c=
lass=3D"com"><br>#include &lt;iostream&gt;<br><br>int main() {<br>    std::=
shared_ptr&lt;void&gt; at_exit_1(nullptr, [](...){ std::cout &lt;&lt; 4; })=
;<br>    std::cout &lt;&lt; 1;<br><br>    std::shared_ptr&lt;void&gt; at_ex=
it_2(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>    std::cout &lt;&lt; =
2;<br>}</span></span></code><code><span style=3D"font-family: courier new,m=
onospace;"><span class=3D"pun"></span><span class=3D"pln"></span></span><sp=
an class=3D"pun"><span style=3D"font-family: courier new,monospace;"></span=
><br><br>which could be rewritten like:<br></span></code><br><code><span cl=
ass=3D"pun"><code><span style=3D"font-family: courier new,monospace;"><span=
 class=3D"com">#include</span><span class=3D"pln"> </span><span class=3D"st=
r">&lt;memory&gt;</span><span class=3D"pln"></span><span class=3D"com"><br>=
#include &lt;iostream&gt;<br><br>int main() {<br>    defer std::shared_ptr&=
lt;void&gt;(nullptr, [](...){ std::cout &lt;&lt; 4; });<br>    std::cout &l=
t;&lt; 1;<br><br>    defer std::shared_ptr&lt;void&gt;(nullptr, [](...){ st=
d::cout &lt;&lt; 3; });<br>    std::cout &lt;&lt; 2;<br>}</span></span></co=
de><br><br>without having to care for naming without necessity.<br><br>I kn=
ow such kind of situation happen not only when using that kind of <span sty=
le=3D"font-family: courier new,monospace;">at_exit</span><br>trick, but als=
o, this is a feature that couples perfectly to <span style=3D"font-family: =
courier new,monospace;">std::lock_guard</span><br>or any kind of guard for =
that matter.<br><br>This would also have a strong connection with the <span=
 style=3D"font-family: courier new,monospace;">scope_exit &amp; unique_reso=
urce</span><br>proposal.<br><br>The keyword is inspired in the <span style=
=3D"font-family: courier new,monospace;">defer</span> keyword from the Go p=
rogramming language.<br><br>Actually, I just happened to come here after re=
viewing some questions on StackOverflow<br>where I have had participation:<=
br><br>- <a href=3D"http://stackoverflow.com/questions/33050620">http://sta=
ckoverflow.com/questions/33050620</a><br><br>Regards,<br>Francisco Lopes<br=
></span></code></pre></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/76395bd2-5288-439a-9002-bd7a950cf32c%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/76395bd2-5288-439a-9002-bd7a950cf32c=
%40isocpp.org</a>.<br />

------=_Part_386_698857760.1468101713723--

------=_Part_385_1572831691.1468101713722--

.


Author: Francisco Lopes <francisco.mailing.lists@oblita.com>
Date: Sat, 9 Jul 2016 15:10:11 -0700 (PDT)
Raw View
------=_Part_6520_1550484776.1468102211434
Content-Type: multipart/alternative;
 boundary="----=_Part_6521_1486162984.1468102211434"

------=_Part_6521_1486162984.1468102211434
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Ah, I just realized... new keyword yeah, it's problematic to add. But I=20
care more
for the feature, not how it enters, so let's assume that requiring a new=20
keyword
is not a requirement in the proposal.

Em s=C3=A1bado, 9 de julho de 2016 19:01:54 UTC-3, Francisco Lopes escreveu=
:
>
> It has been some years this idea floats in my mind as a nice feature, so=
=20
> I'd like
> to ask you guys whether you also feel it would be helpful as I think so,=
=20
> it's my first proposal sketch here.
>
> I'd like to suggest a new keyword, *defer*, whose main purpose is to=20
> extend
> the lifetime of a temporary following it, to the enclosing scope.
>
> Which would help on situations like this
>
> #include <memory>
> #include <iostream>
>
> int main() {
>     std::shared_ptr<void> at_exit_1(nullptr, [](...){ std::cout << 4; });
>     std::cout << 1;
>
>     std::shared_ptr<void> at_exit_2(nullptr, [](...){ std::cout << 3; });
>     std::cout << 2;
> }
>
> which could be rewritten like:
>
> #include <memory>
> #include <iostream>
>
> int main() {
>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 4; });
>     std::cout << 1;
>
>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 3; });
>     std::cout << 2;
> }
>
> without having to care for naming without necessity.
>
> I know such kind of situation happen not only when using that kind of at_=
exit
> trick, but also, this is a feature that couples perfectly to std::lock_gu=
ard
> or any kind of guard for that matter.
>
> This would also have a strong connection with the scope_exit & unique_res=
ource
> proposal.
>
> The keyword is inspired in the defer keyword from the Go programming lang=
uage.
>
> Actually, I just happened to come here after reviewing some questions on =
StackOverflow
> where I have had participation:
>
> - http://stackoverflow.com/questions/33050620
>
> Regards,
> Francisco Lopes
>
>

--=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/99c2cfad-71a5-4ef6-8c6c-219fd4f89eed%40isocpp.or=
g.

------=_Part_6521_1486162984.1468102211434
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Ah, I just realized... new keyword yeah, it&#39;s problema=
tic to add. But I care more<br>for the feature, not how it enters, so let&#=
39;s assume that requiring a new keyword<br>is not a requirement in the pro=
posal.<br><br>Em s=C3=A1bado, 9 de julho de 2016 19:01:54 UTC-3, Francisco =
Lopes  escreveu:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin=
-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"lt=
r">It has been some years this idea floats in my mind as a nice feature, so=
 I&#39;d like<br>to ask you guys whether you also feel it would be helpful =
as I think so, it&#39;s my first proposal sketch here.<br><br>I&#39;d like =
to suggest a new keyword, <span style=3D"font-family:courier new,monospace"=
><b>defer</b></span>, whose main purpose is to extend<br>the lifetime of a =
temporary following it, to the enclosing scope.<br><br>Which would help on =
situations like this<br><br><pre><code><span style=3D"font-family:courier n=
ew,monospace"><span>#include</span><span> </span><span>&lt;memory&gt;</span=
><span></span><span><br>#include &lt;iostream&gt;<br><br>int main() {<br>  =
  std::shared_ptr&lt;void&gt; at_exit_1(nullptr, [](...){ std::cout &lt;&lt=
; 4; });<br>    std::cout &lt;&lt; 1;<br><br>    std::shared_ptr&lt;void&gt=
; at_exit_2(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>    std::cout &l=
t;&lt; 2;<br>}</span></span></code><code><span style=3D"font-family:courier=
 new,monospace"><span></span><span></span></span><span><span style=3D"font-=
family:courier new,monospace"></span><br><br>which could be rewritten like:=
<br></span></code><br><code><span><code><span style=3D"font-family:courier =
new,monospace"><span>#include</span><span> </span><span>&lt;memory&gt;</spa=
n><span></span><span><br>#include &lt;iostream&gt;<br><br>int main() {<br> =
   defer std::shared_ptr&lt;void&gt;(nullptr, [](...){ std::cout &lt;&lt; 4=
; });<br>    std::cout &lt;&lt; 1;<br><br>    defer std::shared_ptr&lt;void=
&gt;(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>    std::cout &lt;&lt; =
2;<br>}</span></span></code><br><br>without having to care for naming witho=
ut necessity.<br><br>I know such kind of situation happen not only when usi=
ng that kind of <span style=3D"font-family:courier new,monospace">at_exit</=
span><br>trick, but also, this is a feature that couples perfectly to <span=
 style=3D"font-family:courier new,monospace">std::lock_guard</span><br>or a=
ny kind of guard for that matter.<br><br>This would also have a strong conn=
ection with the <span style=3D"font-family:courier new,monospace">scope_exi=
t &amp; unique_resource</span><br>proposal.<br><br>The keyword is inspired =
in the <span style=3D"font-family:courier new,monospace">defer</span> keywo=
rd from the Go programming language.<br><br>Actually, I just happened to co=
me here after reviewing some questions on StackOverflow<br>where I have had=
 participation:<br><br>- <a href=3D"http://stackoverflow.com/questions/3305=
0620" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;ht=
tp://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F3=
3050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01-lJ-uW5BqJ_c=
A&#39;;return true;" onclick=3D"this.href=3D&#39;http://www.google.com/url?=
q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F33050620\x26sa\x3dD\x26sn=
tz\x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01-lJ-uW5BqJ_cA&#39;;return true;">htt=
p://stackoverflow.com/<wbr>questions/33050620</a><br><br>Regards,<br>Franci=
sco Lopes<br></span></code></pre></div></blockquote></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/99c2cfad-71a5-4ef6-8c6c-219fd4f89eed%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/99c2cfad-71a5-4ef6-8c6c-219fd4f89eed=
%40isocpp.org</a>.<br />

------=_Part_6521_1486162984.1468102211434--

------=_Part_6520_1550484776.1468102211434--

.


Author: Francisco Lopes <francisco.mailing.lists@oblita.com>
Date: Sat, 9 Jul 2016 15:26:56 -0700 (PDT)
Raw View
------=_Part_6528_707729491.1468103216406
Content-Type: multipart/alternative;
 boundary="----=_Part_6529_1305217289.1468103216406"

------=_Part_6529_1305217289.1468103216406
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

It would also be like having the hability of declaring anonymous variables.
It could be possible to obtain the same as defer if it was possible to have
a special variable name placeholder that in truth woudn't name anything, it=
=20
could
be auto?!

#include <memory>
#include <iostream>

int main() {
    std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 4; });
    std::cout << 1;

    std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 3; });
    std::cout << 2;
}

Anyway, I'd not like to disperse, just focus on the functionality.

Em s=C3=A1bado, 9 de julho de 2016 19:10:12 UTC-3, Francisco Lopes escreveu=
:
>
> Ah, I just realized... new keyword yeah, it's problematic to add. But I=
=20
> care more
> for the feature, not how it enters, so let's assume that requiring a new=
=20
> keyword
> is not a requirement in the proposal.
>
> Em s=C3=A1bado, 9 de julho de 2016 19:01:54 UTC-3, Francisco Lopes escrev=
eu:
>>
>> It has been some years this idea floats in my mind as a nice feature, so=
=20
>> I'd like
>> to ask you guys whether you also feel it would be helpful as I think so,=
=20
>> it's my first proposal sketch here.
>>
>> I'd like to suggest a new keyword, *defer*, whose main purpose is to=20
>> extend
>> the lifetime of a temporary following it, to the enclosing scope.
>>
>> Which would help on situations like this
>>
>> #include <memory>
>> #include <iostream>
>>
>> int main() {
>>     std::shared_ptr<void> at_exit_1(nullptr, [](...){ std::cout << 4; })=
;
>>     std::cout << 1;
>>
>>     std::shared_ptr<void> at_exit_2(nullptr, [](...){ std::cout << 3; })=
;
>>     std::cout << 2;
>> }
>>
>> which could be rewritten like:
>>
>> #include <memory>
>> #include <iostream>
>>
>> int main() {
>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 4; });
>>     std::cout << 1;
>>
>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 3; });
>>     std::cout << 2;
>> }
>>
>> without having to care for naming without necessity.
>>
>> I know such kind of situation happen not only when using that kind of at=
_exit
>> trick, but also, this is a feature that couples perfectly to std::lock_g=
uard
>> or any kind of guard for that matter.
>>
>> This would also have a strong connection with the scope_exit & unique_re=
source
>> proposal.
>>
>> The keyword is inspired in the defer keyword from the Go programming lan=
guage.
>>
>> Actually, I just happened to come here after reviewing some questions on=
 StackOverflow
>> where I have had participation:
>>
>> - http://stackoverflow.com/questions/33050620
>>
>> Regards,
>> Francisco Lopes
>>
>>

--=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/c7f9426b-47db-4760-848d-19354dd5fa82%40isocpp.or=
g.

------=_Part_6529_1305217289.1468103216406
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">It would also be like having the hability of declaring ano=
nymous variables.<br>It could be possible to obtain the same as defer if it=
 was possible to have<br>a special variable name placeholder that in truth =
woudn&#39;t name anything, it could<br>be auto?!<br><br><span style=3D"font=
-family: courier new,monospace;">#include &lt;memory&gt;<br>#include &lt;io=
stream&gt;<br><br>int main() {<br>=C2=A0=C2=A0=C2=A0 std::shared_ptr&lt;voi=
d&gt; auto(nullptr, [](...){ std::cout &lt;&lt; 4; });<br>=C2=A0=C2=A0=C2=
=A0 std::cout &lt;&lt; 1;<br><br>=C2=A0=C2=A0=C2=A0 std::shared_ptr&lt;void=
&gt; auto(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>=C2=A0=C2=A0=C2=A0=
 std::cout &lt;&lt; 2;<br>}</span><br><br>Anyway, I&#39;d not like to dispe=
rse, just focus on the functionality.<br><br>Em s=C3=A1bado, 9 de julho de =
2016 19:10:12 UTC-3, Francisco Lopes  escreveu:<blockquote class=3D"gmail_q=
uote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;pad=
ding-left: 1ex;"><div dir=3D"ltr">Ah, I just realized... new keyword yeah, =
it&#39;s problematic to add. But I care more<br>for the feature, not how it=
 enters, so let&#39;s assume that requiring a new keyword<br>is not a requi=
rement in the proposal.<br><br>Em s=C3=A1bado, 9 de julho de 2016 19:01:54 =
UTC-3, Francisco Lopes  escreveu:<blockquote class=3D"gmail_quote" style=3D=
"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><d=
iv dir=3D"ltr">It has been some years this idea floats in my mind as a nice=
 feature, so I&#39;d like<br>to ask you guys whether you also feel it would=
 be helpful as I think so, it&#39;s my first proposal sketch here.<br><br>I=
&#39;d like to suggest a new keyword, <span style=3D"font-family:courier ne=
w,monospace"><b>defer</b></span>, whose main purpose is to extend<br>the li=
fetime of a temporary following it, to the enclosing scope.<br><br>Which wo=
uld help on situations like this<br><br><pre><code><span style=3D"font-fami=
ly:courier new,monospace"><span>#include</span><span> </span><span>&lt;memo=
ry&gt;</span><span></span><span><br>#include &lt;iostream&gt;<br><br>int ma=
in() {<br>    std::shared_ptr&lt;void&gt; at_exit_1(nullptr, [](...){ std::=
cout &lt;&lt; 4; });<br>    std::cout &lt;&lt; 1;<br><br>    std::shared_pt=
r&lt;void&gt; at_exit_2(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>    =
std::cout &lt;&lt; 2;<br>}</span></span></code><code><span style=3D"font-fa=
mily:courier new,monospace"><span></span><span></span></span><span><span st=
yle=3D"font-family:courier new,monospace"></span><br><br>which could be rew=
ritten like:<br></span></code><br><code><span><code><span style=3D"font-fam=
ily:courier new,monospace"><span>#include</span><span> </span><span>&lt;mem=
ory&gt;</span><span></span><span><br>#include &lt;iostream&gt;<br><br>int m=
ain() {<br>    defer std::shared_ptr&lt;void&gt;(nullptr, [](...){ std::cou=
t &lt;&lt; 4; });<br>    std::cout &lt;&lt; 1;<br><br>    defer std::shared=
_ptr&lt;void&gt;(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>    std::co=
ut &lt;&lt; 2;<br>}</span></span></code><br><br>without having to care for =
naming without necessity.<br><br>I know such kind of situation happen not o=
nly when using that kind of <span style=3D"font-family:courier new,monospac=
e">at_exit</span><br>trick, but also, this is a feature that couples perfec=
tly to <span style=3D"font-family:courier new,monospace">std::lock_guard</s=
pan><br>or any kind of guard for that matter.<br><br>This would also have a=
 strong connection with the <span style=3D"font-family:courier new,monospac=
e">scope_exit &amp; unique_resource</span><br>proposal.<br><br>The keyword =
is inspired in the <span style=3D"font-family:courier new,monospace">defer<=
/span> keyword from the Go programming language.<br><br>Actually, I just ha=
ppened to come here after reviewing some questions on StackOverflow<br>wher=
e I have had participation:<br><br>- <a href=3D"http://stackoverflow.com/qu=
estions/33050620" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"this.hr=
ef=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fq=
uestions%2F33050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01=
-lJ-uW5BqJ_cA&#39;;return true;" onclick=3D"this.href=3D&#39;http://www.goo=
gle.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F33050620\x26s=
a\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01-lJ-uW5BqJ_cA&#39;;retur=
n true;">http://stackoverflow.com/<wbr>questions/33050620</a><br><br>Regard=
s,<br>Francisco Lopes<br></span></code></pre></div></blockquote></div></blo=
ckquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/c7f9426b-47db-4760-848d-19354dd5fa82%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/c7f9426b-47db-4760-848d-19354dd5fa82=
%40isocpp.org</a>.<br />

------=_Part_6529_1305217289.1468103216406--

------=_Part_6528_707729491.1468103216406--

.


Author: Tony V E <tvaneerd@gmail.com>
Date: Sat, 09 Jul 2016 19:29:56 -0400
Raw View
<html><head></head><body lang=3D"en-US" style=3D"background-color: rgb(255,=
 255, 255); line-height: initial;">                                        =
                                              <div style=3D"width: 100%; fo=
nt-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);">I've been considering a feature where we could use (and reuse) =
_ as an anonymous variable name.&nbsp;</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, 25=
5, 255);"><br></div><div style=3D"width: 100%; font-size: initial; font-fam=
ily: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125);=
 text-align: initial; background-color: rgb(255, 255, 255);">Foo _ =3D 10; =
//allowed today</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);">_.member(); /=
/ ok</div><div style=3D"width: 100%; font-size: initial; font-family: Calib=
ri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-alig=
n: initial; background-color: rgb(255, 255, 255);">Bar _ =3D 5; // new - an=
onymous variable<span style=3D"font-size: initial; text-align: initial; lin=
e-height: initial;">=E2=80=8E (both _ in scope)</span></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);">_.func(); // compile failure=E2=80=8E - ambiguous=
 _</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);"><span style=3D"font-size: =
initial; line-height: initial; text-align: initial;"><br></span></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; bac=
kground-color: rgb(255, 255, 255);"><span style=3D"font-size: initial; line=
-height: initial; text-align: initial;"><br></span></div><div style=3D"widt=
h: 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);">Basically allow one or more variables named _.&nbsp;=
</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: i=
nitial; background-color: rgb(255, 255, 255);">If you have just one, then e=
verything works as today (backwards compatible).&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);=
">Once you have more than one _ variable, they all become anonymous. </div>=
                                                                           =
                                                          <div style=3D"wid=
th: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif=
, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-colo=
r: rgb(255, 255, 255);"><br style=3D"display:initial"></div>               =
                                                                           =
                                                                           =
                              <div style=3D"font-size: initial; font-family=
: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); te=
xt-align: initial; background-color: rgb(255, 255, 255);">Sent&nbsp;from&nb=
sp;my&nbsp;BlackBerry&nbsp;portable&nbsp;Babbage&nbsp;Device</div>         =
                                                                           =
                                                                           =
                   <table width=3D"100%" style=3D"background-color:white;bo=
rder-spacing:0px;"> <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-colo=
r: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0in 0in; font-fa=
mily: Tahoma, 'BB Alpha Sans', 'Slate Pro'; font-size: 10pt;">  <div><b>Fro=
m: </b>Francisco Lopes</div><div><b>Sent: </b>Saturday, July 9, 2016 6:26 P=
M</div><div><b>To: </b>ISO C++ Standard - Future Proposals</div><div><b>Rep=
ly To: </b>std-proposals@isocpp.org</div><div><b>Subject: </b>[std-proposal=
s] Re: deferring destruction</div></div></td></tr></tbody></table><div styl=
e=3D"border-style: solid none none; border-top-color: rgb(186, 188, 209); b=
order-top-width: 1pt; font-size: initial; text-align: initial; background-c=
olor: rgb(255, 255, 255);"></div><br><div id=3D"_originalContent" style=3D"=
"><div dir=3D"ltr">It would also be like having the hability of declaring a=
nonymous variables.<br>It could be possible to obtain the same as defer if =
it was possible to have<br>a special variable name placeholder that in trut=
h woudn't name anything, it could<br>be auto?!<br><br><span style=3D"font-f=
amily: courier new,monospace;">#include &lt;memory&gt;<br>#include &lt;iost=
ream&gt;<br><br>int main() {<br>&nbsp;&nbsp;&nbsp; std::shared_ptr&lt;void&=
gt; auto(nullptr, [](...){ std::cout &lt;&lt; 4; });<br>&nbsp;&nbsp;&nbsp; =
std::cout &lt;&lt; 1;<br><br>&nbsp;&nbsp;&nbsp; std::shared_ptr&lt;void&gt;=
 auto(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>&nbsp;&nbsp;&nbsp; std=
::cout &lt;&lt; 2;<br>}</span><br><br>Anyway, I'd not like to disperse, jus=
t focus on the functionality.<br><br>Em s=C3=A1bado, 9 de julho de 2016 19:=
10:12 UTC-3, Francisco Lopes  escreveu:<blockquote class=3D"gmail_quote" st=
yle=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-lef=
t: 1ex;"><div dir=3D"ltr">Ah, I just realized... new keyword yeah, it's pro=
blematic to add. But I care more<br>for the feature, not how it enters, so =
let's assume that requiring a new keyword<br>is not a requirement in the pr=
oposal.<br><br>Em s=C3=A1bado, 9 de julho de 2016 19:01:54 UTC-3, Francisco=
 Lopes  escreveu:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin=
-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">I=
t has been some years this idea floats in my mind as a nice feature, so I'd=
 like<br>to ask you guys whether you also feel it would be helpful as I thi=
nk so, it's my first proposal sketch here.<br><br>I'd like to suggest a new=
 keyword, <span style=3D"font-family:courier new,monospace"><b>defer</b></s=
pan>, whose main purpose is to extend<br>the lifetime of a temporary follow=
ing it, to the enclosing scope.<br><br>Which would help on situations like =
this<br><br><pre><code><span style=3D"font-family:courier new,monospace"><s=
pan>#include</span><span> </span><span>&lt;memory&gt;</span><span></span><s=
pan><br>#include &lt;iostream&gt;<br><br>int main() {<br>    std::shared_pt=
r&lt;void&gt; at_exit_1(nullptr, [](...){ std::cout &lt;&lt; 4; });<br>    =
std::cout &lt;&lt; 1;<br><br>    std::shared_ptr&lt;void&gt; at_exit_2(null=
ptr, [](...){ std::cout &lt;&lt; 3; });<br>    std::cout &lt;&lt; 2;<br>}</=
span></span></code><code><span style=3D"font-family:courier new,monospace">=
<span></span><span></span></span><span><span style=3D"font-family:courier n=
ew,monospace"></span><br><br>which could be rewritten like:<br></span></cod=
e><br><code><span><code><span style=3D"font-family:courier new,monospace"><=
span>#include</span><span> </span><span>&lt;memory&gt;</span><span></span><=
span><br>#include &lt;iostream&gt;<br><br>int main() {<br>    defer std::sh=
ared_ptr&lt;void&gt;(nullptr, [](...){ std::cout &lt;&lt; 4; });<br>    std=
::cout &lt;&lt; 1;<br><br>    defer std::shared_ptr&lt;void&gt;(nullptr, []=
(...){ std::cout &lt;&lt; 3; });<br>    std::cout &lt;&lt; 2;<br>}</span></=
span></code><br><br>without having to care for naming without necessity.<br=
><br>I know such kind of situation happen not only when using that kind of =
<span style=3D"font-family:courier new,monospace">at_exit</span><br>trick, =
but also, this is a feature that couples perfectly to <span style=3D"font-f=
amily:courier new,monospace">std::lock_guard</span><br>or any kind of guard=
 for that matter.<br><br>This would also have a strong connection with the =
<span style=3D"font-family:courier new,monospace">scope_exit &amp; unique_r=
esource</span><br>proposal.<br><br>The keyword is inspired in the <span sty=
le=3D"font-family:courier new,monospace">defer</span> keyword from the Go p=
rogramming language.<br><br>Actually, I just happened to come here after re=
viewing some questions on StackOverflow<br>where I have had participation:<=
br><br>- <a href=3D"http://stackoverflow.com/questions/33050620" rel=3D"nof=
ollow" target=3D"_blank" onmousedown=3D"this.href=3D'http://www.google.com/=
url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F33050620\x26sa\x3dD\x=
26sntz\x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01-lJ-uW5BqJ_cA';return true;" onc=
lick=3D"this.href=3D'http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverf=
low.com%2Fquestions%2F33050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFOBl=
SwGNeSefe01-lJ-uW5BqJ_cA';return true;">http://stackoverflow.com/<wbr>quest=
ions/33050620</a><br><br>Regards,<br>Francisco Lopes<br></span></code></pre=
></div></blockquote></div></blockquote></div>

<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/c7f9426b-47db-4760-848d-19354dd5fa82%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter">https://groups.goo=
gle.com/a/isocpp.org/d/msgid/std-proposals/c7f9426b-47db-4760-848d-19354dd5=
fa82%40isocpp.org</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/20160709232702.4919375.31682.13578%40=
gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com=
/a/isocpp.org/d/msgid/std-proposals/20160709232702.4919375.31682.13578%40gm=
ail.com</a>.<br />

.


Author: Francisco Lopes <francisco.mailing.lists@oblita.com>
Date: Sat, 9 Jul 2016 17:10:23 -0700 (PDT)
Raw View
------=_Part_1057_2051758718.1468109423330
Content-Type: multipart/alternative;
 boundary="----=_Part_1058_1289777088.1468109423330"

------=_Part_1058_1289777088.1468109423330
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

I've considered (but not commented) about using _ too. It's what I employ
in the referred stackoverflow link.

You approach is interesting, another one that's also backwards compatible
is to make _ refer to the last object, overriding the previous one without
destructing it on overriding.

Em s=C3=A1bado, 9 de julho de 2016 20:30:01 UTC-3, Tony V E escreveu:
>
> I've been considering a feature where we could use (and reuse) _ as an=20
> anonymous variable name.=20
>
> Foo _ =3D 10; //allowed today
> _.member(); // ok
> Bar _ =3D 5; // new - anonymous variable=E2=80=8E (both _ in scope)
> _.func(); // compile failure=E2=80=8E - ambiguous _
>
>
> Basically allow one or more variables named _.=20
> If you have just one, then everything works as today (backwards=20
> compatible).=20
>
> Once you have more than one _ variable, they all become anonymous.=20
>
> Sent from my BlackBerry portable Babbage Device
> *From: *Francisco Lopes
> *Sent: *Saturday, July 9, 2016 6:26 PM
> *To: *ISO C++ Standard - Future Proposals
> *Reply To: *std-pr...@isocpp.org <javascript:>
> *Subject: *[std-proposals] Re: deferring destruction
>
> It would also be like having the hability of declaring anonymous variable=
s.
> It could be possible to obtain the same as defer if it was possible to ha=
ve
> a special variable name placeholder that in truth woudn't name anything,=
=20
> it could
> be auto?!
>
> #include <memory>
> #include <iostream>
>
> int main() {
>     std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 4; });
>     std::cout << 1;
>
>     std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 3; });
>     std::cout << 2;
> }
>
> Anyway, I'd not like to disperse, just focus on the functionality.
>
> Em s=C3=A1bado, 9 de julho de 2016 19:10:12 UTC-3, Francisco Lopes escrev=
eu:
>>
>> Ah, I just realized... new keyword yeah, it's problematic to add. But I=
=20
>> care more
>> for the feature, not how it enters, so let's assume that requiring a new=
=20
>> keyword
>> is not a requirement in the proposal.
>>
>> Em s=C3=A1bado, 9 de julho de 2016 19:01:54 UTC-3, Francisco Lopes escre=
veu:
>>>
>>> It has been some years this idea floats in my mind as a nice feature, s=
o=20
>>> I'd like
>>> to ask you guys whether you also feel it would be helpful as I think so=
,=20
>>> it's my first proposal sketch here.
>>>
>>> I'd like to suggest a new keyword, *defer*, whose main purpose is to=20
>>> extend
>>> the lifetime of a temporary following it, to the enclosing scope.
>>>
>>> Which would help on situations like this
>>>
>>> #include <memory>
>>> #include <iostream>
>>>
>>> int main() {
>>>     std::shared_ptr<void> at_exit_1(nullptr, [](...){ std::cout << 4; }=
);
>>>     std::cout << 1;
>>>
>>>     std::shared_ptr<void> at_exit_2(nullptr, [](...){ std::cout << 3; }=
);
>>>     std::cout << 2;
>>> }
>>>
>>> which could be rewritten like:
>>>
>>> #include <memory>
>>> #include <iostream>
>>>
>>> int main() {
>>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 4; });
>>>     std::cout << 1;
>>>
>>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 3; });
>>>     std::cout << 2;
>>> }
>>>
>>> without having to care for naming without necessity.
>>>
>>> I know such kind of situation happen not only when using that kind of a=
t_exit
>>> trick, but also, this is a feature that couples perfectly to std::lock_=
guard
>>> or any kind of guard for that matter.
>>>
>>> This would also have a strong connection with the scope_exit & unique_r=
esource
>>> proposal.
>>>
>>> The keyword is inspired in the defer keyword from the Go programming la=
nguage.
>>>
>>> Actually, I just happened to come here after reviewing some questions o=
n StackOverflow
>>> where I have had participation:
>>>
>>> - http://stackoverflow.com/questions/33050620
>>>
>>> Regards,
>>> Francisco Lopes
>>>
>>> --=20
> You received this message because you are subscribed to the Google Groups=
=20
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an=
=20
> email to std-proposal...@isocpp.org <javascript:>.
> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
> To view this discussion on the web visit=20
> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c7f9426b-47d=
b-4760-848d-19354dd5fa82%40isocpp.org=20
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c7f9426b-47=
db-4760-848d-19354dd5fa82%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>
>

--=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/a07f7710-729a-47ed-ae48-105c2e7699f3%40isocpp.or=
g.

------=_Part_1058_1289777088.1468109423330
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I&#39;ve considered (but not commented) about using _ too.=
 It&#39;s what I employ<br>in the referred stackoverflow link.<br><br>You a=
pproach is interesting, another one that&#39;s also backwards compatible<br=
>is to make _ refer to the last object, overriding the previous one without=
<br>destructing it on overriding.<br><br>Em s=C3=A1bado, 9 de julho de 2016=
 20:30:01 UTC-3, Tony V E  escreveu:<blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;"><div style=3D"background-color:rgb(255,255,255);line-height:initial" =
lang=3D"en-US">                                                            =
                          <div style=3D"width:100%;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)">I&#39;ve been consi=
dering a feature where we could use (and reuse) _ as an anonymous variable =
name.=C2=A0</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)"><br></div><div style=3D"widt=
h: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(25=
5,255,255)">Foo _ =3D 10; //allowed today</div><div style=3D"width:100%;fon=
t-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-seri=
f;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)=
">_.member(); // ok</div><div style=3D"width:100%;font-size:initial;font-fa=
mily:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125)=
;text-align:initial;background-color:rgb(255,255,255)">Bar _ =3D 5; // new =
- anonymous variable<span style=3D"font-size:initial;text-align:initial;lin=
e-height:initial">=E2=80=8E (both _ in scope)</span></div><div style=3D"wid=
th:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-seri=
f,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(2=
55,255,255)">_.func(); // compile failure=E2=80=8E - ambiguous _</div><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)"><span style=3D"font-size:initial;line-height:initi=
al;text-align:initial"><br></span></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)"><span=
 style=3D"font-size:initial;line-height:initial;text-align:initial"><br></s=
pan></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)">Basically allow one or more variabl=
es named _.=C2=A0</div><div style=3D"width:100%;font-size:initial;font-fami=
ly:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);t=
ext-align:initial;background-color:rgb(255,255,255)">If you have just one, =
then everything works as today (backwards compatible).=C2=A0</div><div styl=
e=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,s=
ans-serif,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:initial;f=
ont-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,7=
3,125);text-align:initial;background-color:rgb(255,255,255)">Once you have =
more than one _ variable, they all become anonymous. </div>                =
                                                                           =
                                          <div style=3D"width:100%;font-siz=
e:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;col=
or: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;background-co=
lor:rgb(255,255,255)">Sent=C2=A0from=C2=A0my=C2=A0BlackBerry=C2=A0<wbr>port=
able=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-c=
olor:rgb(255,255,255)">                           <div style=3D"border-styl=
e:solid none none;border-top-color:rgb(181,196,223);border-top-width:1pt;pa=
dding:3pt 0in 0in;font-family:Tahoma,&#39;BB Alpha Sans&#39;,&#39;Slate Pro=
&#39;;font-size:10pt">  <div><b>From: </b>Francisco Lopes</div><div><b>Sent=
: </b>Saturday, July 9, 2016 6:26 PM</div><div><b>To: </b>ISO C++ Standard =
- Future Proposals</div><div><b>Reply To: </b><a href=3D"javascript:" targe=
t=3D"_blank" gdf-obfuscated-mailto=3D"JWkYRnndCQAJ" rel=3D"nofollow" onmous=
edown=3D"this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.hr=
ef=3D&#39;javascript:&#39;;return true;">std-pr...@isocpp.org</a></div><div=
><b>Subject: </b>[std-proposals] Re: deferring destruction</div></div></td>=
</tr></tbody></table><div style=3D"border-style:solid none none;border-top-=
color:rgb(186,188,209);border-top-width:1pt;font-size:initial;text-align:in=
itial;background-color:rgb(255,255,255)"></div><br><div><div dir=3D"ltr">It=
 would also be like having the hability of declaring anonymous variables.<b=
r>It could be possible to obtain the same as defer if it was possible to ha=
ve<br>a special variable name placeholder that in truth woudn&#39;t name an=
ything, it could<br>be auto?!<br><br><span style=3D"font-family:courier new=
,monospace">#include &lt;memory&gt;<br>#include &lt;iostream&gt;<br><br>int=
 main() {<br>=C2=A0=C2=A0=C2=A0 std::shared_ptr&lt;void&gt; auto(nullptr, [=
](...){ std::cout &lt;&lt; 4; });<br>=C2=A0=C2=A0=C2=A0 std::cout &lt;&lt; =
1;<br><br>=C2=A0=C2=A0=C2=A0 std::shared_ptr&lt;void&gt; auto(nullptr, [](.=
...){ std::cout &lt;&lt; 3; });<br>=C2=A0=C2=A0=C2=A0 std::cout &lt;&lt; 2;<=
br>}</span><br><br>Anyway, I&#39;d not like to disperse, just focus on the =
functionality.<br><br>Em s=C3=A1bado, 9 de julho de 2016 19:10:12 UTC-3, Fr=
ancisco Lopes  escreveu:<blockquote class=3D"gmail_quote" style=3D"margin:0=
;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D=
"ltr">Ah, I just realized... new keyword yeah, it&#39;s problematic to add.=
 But I care more<br>for the feature, not how it enters, so let&#39;s assume=
 that requiring a new keyword<br>is not a requirement in the proposal.<br><=
br>Em s=C3=A1bado, 9 de julho de 2016 19:01:54 UTC-3, Francisco Lopes  escr=
eveu:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;=
border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">It has been s=
ome years this idea floats in my mind as a nice feature, so I&#39;d like<br=
>to ask you guys whether you also feel it would be helpful as I think so, i=
t&#39;s my first proposal sketch here.<br><br>I&#39;d like to suggest a new=
 keyword, <span style=3D"font-family:courier new,monospace"><b>defer</b></s=
pan>, whose main purpose is to extend<br>the lifetime of a temporary follow=
ing it, to the enclosing scope.<br><br>Which would help on situations like =
this<br><br><pre><code><span style=3D"font-family:courier new,monospace"><s=
pan>#include</span><span> </span><span>&lt;memory&gt;</span><span></span><s=
pan><br>#include &lt;iostream&gt;<br><br>int main() {<br>    std::shared_pt=
r&lt;void&gt; at_exit_1(nullptr, [](...){ std::cout &lt;&lt; 4; });<br>    =
std::cout &lt;&lt; 1;<br><br>    std::shared_ptr&lt;void&gt; at_exit_2(null=
ptr, [](...){ std::cout &lt;&lt; 3; });<br>    std::cout &lt;&lt; 2;<br>}</=
span></span></code><code><span style=3D"font-family:courier new,monospace">=
<span></span><span></span></span><span><span style=3D"font-family:courier n=
ew,monospace"></span><br><br>which could be rewritten like:<br></span></cod=
e><br><code><span><code><span style=3D"font-family:courier new,monospace"><=
span>#include</span><span> </span><span>&lt;memory&gt;</span><span></span><=
span><br>#include &lt;iostream&gt;<br><br>int main() {<br>    defer std::sh=
ared_ptr&lt;void&gt;(nullptr, [](...){ std::cout &lt;&lt; 4; });<br>    std=
::cout &lt;&lt; 1;<br><br>    defer std::shared_ptr&lt;void&gt;(nullptr, []=
(...){ std::cout &lt;&lt; 3; });<br>    std::cout &lt;&lt; 2;<br>}</span></=
span></code><br><br>without having to care for naming without necessity.<br=
><br>I know such kind of situation happen not only when using that kind of =
<span style=3D"font-family:courier new,monospace">at_exit</span><br>trick, =
but also, this is a feature that couples perfectly to <span style=3D"font-f=
amily:courier new,monospace">std::lock_guard</span><br>or any kind of guard=
 for that matter.<br><br>This would also have a strong connection with the =
<span style=3D"font-family:courier new,monospace">scope_exit &amp; unique_r=
esource</span><br>proposal.<br><br>The keyword is inspired in the <span sty=
le=3D"font-family:courier new,monospace">defer</span> keyword from the Go p=
rogramming language.<br><br>Actually, I just happened to come here after re=
viewing some questions on StackOverflow<br>where I have had participation:<=
br><br>- <a href=3D"http://stackoverflow.com/questions/33050620" rel=3D"nof=
ollow" target=3D"_blank" onmousedown=3D"this.href=3D&#39;http://www.google.=
com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F33050620\x26sa\x3=
dD\x26sntz\x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01-lJ-uW5BqJ_cA&#39;;return tr=
ue;" onclick=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%=
2Fstackoverflow.com%2Fquestions%2F33050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x=
3dAFQjCNFOBlSwGNeSefe01-lJ-uW5BqJ_cA&#39;;return true;">http://stackoverflo=
w.com/<wbr>questions/33050620</a><br><br>Regards,<br>Francisco Lopes<br></s=
pan></code></pre></div></blockquote></div></blockquote></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"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
JWkYRnndCQAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascript:&=
#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return true=
;">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"JWkYRnndCQAJ" rel=3D"nofollow" onmousedown=3D"=
this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39=
;javascript:&#39;;return true;">std-pr...@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/c7f9426b-47db-4760-848d-19354dd5fa82%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank" =
rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/c7f9426b-47db-4760-848d-19354dd5fa82%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" on=
click=3D"this.href=3D&#39;https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/c7f9426b-47db-4760-848d-19354dd5fa82%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/c7f9426b-47db-4760-<wbr>848d-=
19354dd5fa82%40isocpp.org</a><wbr>.<br>
<br></div></div>
</blockquote></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/a07f7710-729a-47ed-ae48-105c2e7699f3%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/a07f7710-729a-47ed-ae48-105c2e7699f3=
%40isocpp.org</a>.<br />

------=_Part_1058_1289777088.1468109423330--

------=_Part_1057_2051758718.1468109423330--

.


Author: Francisco Lopes <francisco.mailing.lists@oblita.com>
Date: Sat, 9 Jul 2016 17:22:31 -0700 (PDT)
Raw View
------=_Part_3579_950889934.1468110151500
Content-Type: multipart/alternative;
 boundary="----=_Part_3580_944863347.1468110151501"

------=_Part_3580_944863347.1468110151501
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

heh, ok. Using _ made me also connect it with the=20
destructuring/multiple-return proposal.

Em s=C3=A1bado, 9 de julho de 2016 21:10:23 UTC-3, Francisco Lopes escreveu=
:
>
> I've considered (but not commented) about using _ too. It's what I employ
> in the referred stackoverflow link.
>
> You approach is interesting, another one that's also backwards compatible
> is to make _ refer to the last object, overriding the previous one withou=
t
> destructing it on overriding.
>
> Em s=C3=A1bado, 9 de julho de 2016 20:30:01 UTC-3, Tony V E escreveu:
>>
>> I've been considering a feature where we could use (and reuse) _ as an=
=20
>> anonymous variable name.=20
>>
>> Foo _ =3D 10; //allowed today
>> _.member(); // ok
>> Bar _ =3D 5; // new - anonymous variable=E2=80=8E (both _ in scope)
>> _.func(); // compile failure=E2=80=8E - ambiguous _
>>
>>
>> Basically allow one or more variables named _.=20
>> If you have just one, then everything works as today (backwards=20
>> compatible).=20
>>
>> Once you have more than one _ variable, they all become anonymous.=20
>>
>> Sent from my BlackBerry portable Babbage Device
>> *From: *Francisco Lopes
>> *Sent: *Saturday, July 9, 2016 6:26 PM
>> *To: *ISO C++ Standard - Future Proposals
>> *Reply To: *std-pr...@isocpp.org
>> *Subject: *[std-proposals] Re: deferring destruction
>>
>> It would also be like having the hability of declaring anonymous=20
>> variables.
>> It could be possible to obtain the same as defer if it was possible to=
=20
>> have
>> a special variable name placeholder that in truth woudn't name anything,=
=20
>> it could
>> be auto?!
>>
>> #include <memory>
>> #include <iostream>
>>
>> int main() {
>>     std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 4; });
>>     std::cout << 1;
>>
>>     std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 3; });
>>     std::cout << 2;
>> }
>>
>> Anyway, I'd not like to disperse, just focus on the functionality.
>>
>> Em s=C3=A1bado, 9 de julho de 2016 19:10:12 UTC-3, Francisco Lopes escre=
veu:
>>>
>>> Ah, I just realized... new keyword yeah, it's problematic to add. But I=
=20
>>> care more
>>> for the feature, not how it enters, so let's assume that requiring a ne=
w=20
>>> keyword
>>> is not a requirement in the proposal.
>>>
>>> Em s=C3=A1bado, 9 de julho de 2016 19:01:54 UTC-3, Francisco Lopes escr=
eveu:
>>>>
>>>> It has been some years this idea floats in my mind as a nice feature,=
=20
>>>> so I'd like
>>>> to ask you guys whether you also feel it would be helpful as I think=
=20
>>>> so, it's my first proposal sketch here.
>>>>
>>>> I'd like to suggest a new keyword, *defer*, whose main purpose is to=
=20
>>>> extend
>>>> the lifetime of a temporary following it, to the enclosing scope.
>>>>
>>>> Which would help on situations like this
>>>>
>>>> #include <memory>
>>>> #include <iostream>
>>>>
>>>> int main() {
>>>>     std::shared_ptr<void> at_exit_1(nullptr, [](...){ std::cout << 4; =
});
>>>>     std::cout << 1;
>>>>
>>>>     std::shared_ptr<void> at_exit_2(nullptr, [](...){ std::cout << 3; =
});
>>>>     std::cout << 2;
>>>> }
>>>>
>>>> which could be rewritten like:
>>>>
>>>> #include <memory>
>>>> #include <iostream>
>>>>
>>>> int main() {
>>>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 4; });
>>>>     std::cout << 1;
>>>>
>>>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 3; });
>>>>     std::cout << 2;
>>>> }
>>>>
>>>> without having to care for naming without necessity.
>>>>
>>>> I know such kind of situation happen not only when using that kind of =
at_exit
>>>> trick, but also, this is a feature that couples perfectly to std::lock=
_guard
>>>> or any kind of guard for that matter.
>>>>
>>>> This would also have a strong connection with the scope_exit & unique_=
resource
>>>> proposal.
>>>>
>>>> The keyword is inspired in the defer keyword from the Go programming l=
anguage.
>>>>
>>>> Actually, I just happened to come here after reviewing some questions =
on StackOverflow
>>>> where I have had participation:
>>>>
>>>> - http://stackoverflow.com/questions/33050620
>>>>
>>>> Regards,
>>>> Francisco Lopes
>>>>
>>>> --=20
>> You received this message because you are subscribed to the Google Group=
s=20
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n=20
>> email to std-proposal...@isocpp.org.
>> To post to this group, send email to std-pr...@isocpp.org.
>> To view this discussion on the web visit=20
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c7f9426b-47=
db-4760-848d-19354dd5fa82%40isocpp.org=20
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c7f9426b-4=
7db-4760-848d-19354dd5fa82%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoo=
ter>
>> .
>>
>>

--=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/e057593f-72d2-4d3a-a4cb-97e9e0c9240d%40isocpp.or=
g.

------=_Part_3580_944863347.1468110151501
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">heh, ok. Using _ made me also connect it with the destruct=
uring/multiple-return proposal.<br><br>Em s=C3=A1bado, 9 de julho de 2016 2=
1:10:23 UTC-3, Francisco Lopes  escreveu:<blockquote class=3D"gmail_quote" =
style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-l=
eft: 1ex;"><div dir=3D"ltr">I&#39;ve considered (but not commented) about u=
sing _ too. It&#39;s what I employ<br>in the referred stackoverflow link.<b=
r><br>You approach is interesting, another one that&#39;s also backwards co=
mpatible<br>is to make _ refer to the last object, overriding the previous =
one without<br>destructing it on overriding.<br><br>Em s=C3=A1bado, 9 de ju=
lho de 2016 20:30:01 UTC-3, Tony V E  escreveu:<blockquote class=3D"gmail_q=
uote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;paddin=
g-left:1ex"><div style=3D"background-color:rgb(255,255,255);line-height:ini=
tial" 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:rgb(255,255,255)">I&#39;ve been=
 considering a feature where we could use (and reuse) _ as an anonymous var=
iable name.=C2=A0</div><div style=3D"width:100%;font-size:initial;font-fami=
ly:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);t=
ext-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;,sa=
ns-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-colo=
r:rgb(255,255,255)">Foo _ =3D 10; //allowed today</div><div style=3D"width:=
100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,s=
ans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,=
255,255)">_.member(); // ok</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)">Bar _ =3D 5;=
 // new - anonymous variable<span style=3D"font-size:initial;text-align:ini=
tial;line-height:initial">=E2=80=8E (both _ in scope)</span></div><div styl=
e=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,s=
ans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-col=
or:rgb(255,255,255)">_.func(); // compile failure=E2=80=8E - ambiguous _</d=
iv><div style=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slat=
e Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;ba=
ckground-color:rgb(255,255,255)"><span style=3D"font-size:initial;line-heig=
ht:initial;text-align:initial"><br></span></div><div style=3D"width:100%;fo=
nt-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-ser=
if;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255=
)"><span style=3D"font-size:initial;line-height:initial;text-align:initial"=
><br></span></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)">Basically allow one or more=
 variables named _.=C2=A0</div><div style=3D"width:100%;font-size:initial;f=
ont-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,7=
3,125);text-align:initial;background-color:rgb(255,255,255)">If you have ju=
st one, then everything works as today (backwards compatible).=C2=A0</div><=
div style=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pr=
o&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;backgr=
ound-color:rgb(255,255,255)"><br></div><div style=3D"width:100%;font-size:i=
nitial;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)">Once y=
ou have more than one _ variable, they all become anonymous. </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 style=3D"display:initial"></div>                                  =
                                                                           =
                                                                           =
           <div style=3D"font-size:initial;font-family:Calibri,&#39;Slate P=
ro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;backg=
round-color:rgb(255,255,255)">Sent=C2=A0from=C2=A0my=C2=A0BlackBerry=C2=A0<=
wbr>portable=C2=A0Babbage=C2=A0Device</div>                                =
                                                                           =
                                                                       <tab=
le style=3D"background-color:white;border-spacing:0px" width=3D"100%"> <tbo=
dy><tr><td colspan=3D"2" style=3D"font-size:initial;text-align:initial;back=
ground-color:rgb(255,255,255)">                           <div style=3D"bor=
der-style:solid none none;border-top-color:rgb(181,196,223);border-top-widt=
h:1pt;padding:3pt 0in 0in;font-family:Tahoma,&#39;BB Alpha Sans&#39;,&#39;S=
late Pro&#39;;font-size:10pt">  <div><b>From: </b>Francisco Lopes</div><div=
><b>Sent: </b>Saturday, July 9, 2016 6:26 PM</div><div><b>To: </b>ISO C++ S=
tandard - Future Proposals</div><div><b>Reply To: </b><a rel=3D"nofollow">s=
td-pr...@isocpp.org</a></div><div><b>Subject: </b>[std-proposals] Re: defer=
ring destruction</div></div></td></tr></tbody></table><div style=3D"border-=
style:solid none none;border-top-color:rgb(186,188,209);border-top-width:1p=
t;font-size:initial;text-align:initial;background-color:rgb(255,255,255)"><=
/div><br><div><div dir=3D"ltr">It would also be like having the hability of=
 declaring anonymous variables.<br>It could be possible to obtain the same =
as defer if it was possible to have<br>a special variable name placeholder =
that in truth woudn&#39;t name anything, it could<br>be auto?!<br><br><span=
 style=3D"font-family:courier new,monospace">#include &lt;memory&gt;<br>#in=
clude &lt;iostream&gt;<br><br>int main() {<br>=C2=A0=C2=A0=C2=A0 std::share=
d_ptr&lt;void&gt; auto(nullptr, [](...){ std::cout &lt;&lt; 4; });<br>=C2=
=A0=C2=A0=C2=A0 std::cout &lt;&lt; 1;<br><br>=C2=A0=C2=A0=C2=A0 std::shared=
_ptr&lt;void&gt; auto(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>=C2=A0=
=C2=A0=C2=A0 std::cout &lt;&lt; 2;<br>}</span><br><br>Anyway, I&#39;d not l=
ike to disperse, just focus on the functionality.<br><br>Em s=C3=A1bado, 9 =
de julho de 2016 19:10:12 UTC-3, Francisco Lopes  escreveu:<blockquote clas=
s=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc =
solid;padding-left:1ex"><div dir=3D"ltr">Ah, I just realized... new keyword=
 yeah, it&#39;s problematic to add. But I care more<br>for the feature, not=
 how it enters, so let&#39;s assume that requiring a new keyword<br>is not =
a requirement in the proposal.<br><br>Em s=C3=A1bado, 9 de julho de 2016 19=
:01:54 UTC-3, Francisco Lopes  escreveu:<blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:=
1ex"><div dir=3D"ltr">It has been some years this idea floats in my mind as=
 a nice feature, so I&#39;d like<br>to ask you guys whether you also feel i=
t would be helpful as I think so, it&#39;s my first proposal sketch here.<b=
r><br>I&#39;d like to suggest a new keyword, <span style=3D"font-family:cou=
rier new,monospace"><b>defer</b></span>, whose main purpose is to extend<br=
>the lifetime of a temporary following it, to the enclosing scope.<br><br>W=
hich would help on situations like this<br><br><pre><code><span style=3D"fo=
nt-family:courier new,monospace"><span>#include</span><span> </span><span>&=
lt;memory&gt;</span><span></span><span><br>#include &lt;iostream&gt;<br><br=
>int main() {<br>    std::shared_ptr&lt;void&gt; at_exit_1(nullptr, [](...)=
{ std::cout &lt;&lt; 4; });<br>    std::cout &lt;&lt; 1;<br><br>    std::sh=
ared_ptr&lt;void&gt; at_exit_2(nullptr, [](...){ std::cout &lt;&lt; 3; });<=
br>    std::cout &lt;&lt; 2;<br>}</span></span></code><code><span style=3D"=
font-family:courier new,monospace"><span></span><span></span></span><span><=
span style=3D"font-family:courier new,monospace"></span><br><br>which could=
 be rewritten like:<br></span></code><br><code><span><code><span style=3D"f=
ont-family:courier new,monospace"><span>#include</span><span> </span><span>=
&lt;memory&gt;</span><span></span><span><br>#include &lt;iostream&gt;<br><b=
r>int main() {<br>    defer std::shared_ptr&lt;void&gt;(nullptr, [](...){ s=
td::cout &lt;&lt; 4; });<br>    std::cout &lt;&lt; 1;<br><br>    defer std:=
:shared_ptr&lt;void&gt;(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>    =
std::cout &lt;&lt; 2;<br>}</span></span></code><br><br>without having to ca=
re for naming without necessity.<br><br>I know such kind of situation happe=
n not only when using that kind of <span style=3D"font-family:courier new,m=
onospace">at_exit</span><br>trick, but also, this is a feature that couples=
 perfectly to <span style=3D"font-family:courier new,monospace">std::lock_g=
uard</span><br>or any kind of guard for that matter.<br><br>This would also=
 have a strong connection with the <span style=3D"font-family:courier new,m=
onospace">scope_exit &amp; unique_resource</span><br>proposal.<br><br>The k=
eyword is inspired in the <span style=3D"font-family:courier new,monospace"=
>defer</span> keyword from the Go programming language.<br><br>Actually, I =
just happened to come here after reviewing some questions on StackOverflow<=
br>where I have had participation:<br><br>- <a href=3D"http://stackoverflow=
..com/questions/33050620" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"=
this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.=
com%2Fquestions%2F33050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFOBlSwGN=
eSefe01-lJ-uW5BqJ_cA&#39;;return true;" onclick=3D"this.href=3D&#39;http://=
www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F330506=
20\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01-lJ-uW5BqJ_cA&#39=
;;return true;">http://stackoverflow.com/<wbr>questions/33050620</a><br><br=
>Regards,<br>Francisco Lopes<br></span></code></pre></div></blockquote></di=
v></blockquote></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 rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</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/c7f9426b-47db-4760-848d-19354dd5fa82%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank" onmousedown=3D"this.href=3D&#39;https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/c7f9426b-47db-4760-848d-19354dd5fa82%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" on=
click=3D"this.href=3D&#39;https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/c7f9426b-47db-4760-848d-19354dd5fa82%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/c7f9426b-47db-4760-<wbr>848d-=
19354dd5fa82%40isocpp.org</a><wbr>.<br>
<br></div></div>
</blockquote></div></blockquote></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/e057593f-72d2-4d3a-a4cb-97e9e0c9240d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/e057593f-72d2-4d3a-a4cb-97e9e0c9240d=
%40isocpp.org</a>.<br />

------=_Part_3580_944863347.1468110151501--

------=_Part_3579_950889934.1468110151500--

.


Author: Francisco Lopes <francisco.mailing.lists@oblita.com>
Date: Sat, 9 Jul 2016 17:25:54 -0700 (PDT)
Raw View
------=_Part_1285_11244237.1468110355059
Content-Type: multipart/alternative;
 boundary="----=_Part_1286_903530620.1468110355059"

------=_Part_1286_903530620.1468110355059
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Meaning, if we ever get destructuring with a placeholder (afaik it has been=
=20
explicitly excluded from
current proposal) wouldn't it actually touch this same subject?

Em s=C3=A1bado, 9 de julho de 2016 21:22:32 UTC-3, Francisco Lopes escreveu=
:
>
> heh, ok. Using _ made me also connect it with the=20
> destructuring/multiple-return proposal.
>
> Em s=C3=A1bado, 9 de julho de 2016 21:10:23 UTC-3, Francisco Lopes escrev=
eu:
>>
>> I've considered (but not commented) about using _ too. It's what I emplo=
y
>> in the referred stackoverflow link.
>>
>> You approach is interesting, another one that's also backwards compatibl=
e
>> is to make _ refer to the last object, overriding the previous one witho=
ut
>> destructing it on overriding.
>>
>> Em s=C3=A1bado, 9 de julho de 2016 20:30:01 UTC-3, Tony V E escreveu:
>>>
>>> I've been considering a feature where we could use (and reuse) _ as an=
=20
>>> anonymous variable name.=20
>>>
>>> Foo _ =3D 10; //allowed today
>>> _.member(); // ok
>>> Bar _ =3D 5; // new - anonymous variable=E2=80=8E (both _ in scope)
>>> _.func(); // compile failure=E2=80=8E - ambiguous _
>>>
>>>
>>> Basically allow one or more variables named _.=20
>>> If you have just one, then everything works as today (backwards=20
>>> compatible).=20
>>>
>>> Once you have more than one _ variable, they all become anonymous.=20
>>>
>>> Sent from my BlackBerry portable Babbage Device
>>> *From: *Francisco Lopes
>>> *Sent: *Saturday, July 9, 2016 6:26 PM
>>> *To: *ISO C++ Standard - Future Proposals
>>> *Reply To: *std-pr...@isocpp.org
>>> *Subject: *[std-proposals] Re: deferring destruction
>>>
>>> It would also be like having the hability of declaring anonymous=20
>>> variables.
>>> It could be possible to obtain the same as defer if it was possible to=
=20
>>> have
>>> a special variable name placeholder that in truth woudn't name anything=
,=20
>>> it could
>>> be auto?!
>>>
>>> #include <memory>
>>> #include <iostream>
>>>
>>> int main() {
>>>     std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 4; });
>>>     std::cout << 1;
>>>
>>>     std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 3; });
>>>     std::cout << 2;
>>> }
>>>
>>> Anyway, I'd not like to disperse, just focus on the functionality.
>>>
>>> Em s=C3=A1bado, 9 de julho de 2016 19:10:12 UTC-3, Francisco Lopes escr=
eveu:
>>>>
>>>> Ah, I just realized... new keyword yeah, it's problematic to add. But =
I=20
>>>> care more
>>>> for the feature, not how it enters, so let's assume that requiring a=
=20
>>>> new keyword
>>>> is not a requirement in the proposal.
>>>>
>>>> Em s=C3=A1bado, 9 de julho de 2016 19:01:54 UTC-3, Francisco Lopes esc=
reveu:
>>>>>
>>>>> It has been some years this idea floats in my mind as a nice feature,=
=20
>>>>> so I'd like
>>>>> to ask you guys whether you also feel it would be helpful as I think=
=20
>>>>> so, it's my first proposal sketch here.
>>>>>
>>>>> I'd like to suggest a new keyword, *defer*, whose main purpose is to=
=20
>>>>> extend
>>>>> the lifetime of a temporary following it, to the enclosing scope.
>>>>>
>>>>> Which would help on situations like this
>>>>>
>>>>> #include <memory>
>>>>> #include <iostream>
>>>>>
>>>>> int main() {
>>>>>     std::shared_ptr<void> at_exit_1(nullptr, [](...){ std::cout << 4;=
 });
>>>>>     std::cout << 1;
>>>>>
>>>>>     std::shared_ptr<void> at_exit_2(nullptr, [](...){ std::cout << 3;=
 });
>>>>>     std::cout << 2;
>>>>> }
>>>>>
>>>>> which could be rewritten like:
>>>>>
>>>>> #include <memory>
>>>>> #include <iostream>
>>>>>
>>>>> int main() {
>>>>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 4; });
>>>>>     std::cout << 1;
>>>>>
>>>>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 3; });
>>>>>     std::cout << 2;
>>>>> }
>>>>>
>>>>> without having to care for naming without necessity.
>>>>>
>>>>> I know such kind of situation happen not only when using that kind of=
 at_exit
>>>>> trick, but also, this is a feature that couples perfectly to std::loc=
k_guard
>>>>> or any kind of guard for that matter.
>>>>>
>>>>> This would also have a strong connection with the scope_exit & unique=
_resource
>>>>> proposal.
>>>>>
>>>>> The keyword is inspired in the defer keyword from the Go programming =
language.
>>>>>
>>>>> Actually, I just happened to come here after reviewing some questions=
 on StackOverflow
>>>>> where I have had participation:
>>>>>
>>>>> - http://stackoverflow.com/questions/33050620
>>>>>
>>>>> Regards,
>>>>> Francisco Lopes
>>>>>
>>>>> --=20
>>> You received this message because you are subscribed to the Google=20
>>> Groups "ISO C++ Standard - Future Proposals" group.
>>> To unsubscribe from this group and stop receiving emails from it, send=
=20
>>> an email to std-proposal...@isocpp.org.
>>> To post to this group, send email to std-pr...@isocpp.org.
>>> To view this discussion on the web visit=20
>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c7f9426b-4=
7db-4760-848d-19354dd5fa82%40isocpp.org=20
>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c7f9426b-=
47db-4760-848d-19354dd5fa82%40isocpp.org?utm_medium=3Demail&utm_source=3Dfo=
oter>
>>> .
>>>
>>>

--=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/814e3bc4-1e5e-45eb-bcd9-e89b59580fc1%40isocpp.or=
g.

------=_Part_1286_903530620.1468110355059
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Meaning, if we ever get destructuring with a placeholder (=
afaik it has been explicitly excluded from<br>current proposal) wouldn&#39;=
t it actually touch this same subject?<br><br>Em s=C3=A1bado, 9 de julho de=
 2016 21:22:32 UTC-3, Francisco Lopes  escreveu:<blockquote class=3D"gmail_=
quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;pa=
dding-left: 1ex;"><div dir=3D"ltr">heh, ok. Using _ made me also connect it=
 with the destructuring/multiple-return proposal.<br><br>Em s=C3=A1bado, 9 =
de julho de 2016 21:10:23 UTC-3, Francisco Lopes  escreveu:<blockquote clas=
s=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc =
solid;padding-left:1ex"><div dir=3D"ltr">I&#39;ve considered (but not comme=
nted) about using _ too. It&#39;s what I employ<br>in the referred stackove=
rflow link.<br><br>You approach is interesting, another one that&#39;s also=
 backwards compatible<br>is to make _ refer to the last object, overriding =
the previous one without<br>destructing it on overriding.<br><br>Em s=C3=A1=
bado, 9 de julho de 2016 20:30:01 UTC-3, Tony V E  escreveu:<blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc=
 solid;padding-left:1ex"><div style=3D"background-color:rgb(255,255,255);li=
ne-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:rgb(255,255,255)">=
I&#39;ve been considering a feature where we could use (and reuse) _ as an =
anonymous variable name.=C2=A0</div><div style=3D"width:100%;font-size:init=
ial;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:initial;back=
ground-color:rgb(255,255,255)">Foo _ =3D 10; //allowed today</div><div styl=
e=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,s=
ans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-col=
or:rgb(255,255,255)">_.member(); // ok</div><div style=3D"width:100%;font-s=
ize:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;c=
olor:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)">B=
ar _ =3D 5; // new - anonymous variable<span style=3D"font-size:initial;tex=
t-align:initial;line-height:initial">=E2=80=8E (both _ in scope)</span></di=
v><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;bac=
kground-color:rgb(255,255,255)">_.func(); // compile failure=E2=80=8E - amb=
iguous _</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)"><span style=3D"font-size:initia=
l;line-height:initial;text-align:initial"><br></span></div><div style=3D"wi=
dth:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-ser=
if,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(=
255,255,255)"><span style=3D"font-size:initial;line-height:initial;text-ali=
gn:initial"><br></span></div><div style=3D"width:100%;font-size:initial;fon=
t-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,=
125);text-align:initial;background-color:rgb(255,255,255)">Basically allow =
one or more variables named _.=C2=A0</div><div style=3D"width:100%;font-siz=
e:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;col=
or:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)">If =
you have just one, then everything works as today (backwards compatible).=
=C2=A0</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:i=
nitial;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)">Once you have more than one _ variable, they all become anonymous. <=
/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 style=3D"display:initial"></div>                   =
                                                                           =
                                                                           =
                          <div style=3D"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)">Sent=C2=A0from=C2=A0my=C2=A0Bl=
ackBerry=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-ali=
gn:initial;background-color:rgb(255,255,255)">                           <d=
iv 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 S=
ans&#39;,&#39;Slate Pro&#39;;font-size:10pt">  <div><b>From: </b>Francisco =
Lopes</div><div><b>Sent: </b>Saturday, July 9, 2016 6:26 PM</div><div><b>To=
: </b>ISO C++ Standard - Future Proposals</div><div><b>Reply To: </b><a rel=
=3D"nofollow">std-pr...@isocpp.org</a></div><div><b>Subject: </b>[std-propo=
sals] Re: deferring destruction</div></div></td></tr></tbody></table><div s=
tyle=3D"border-style:solid none none;border-top-color:rgb(186,188,209);bord=
er-top-width:1pt;font-size:initial;text-align:initial;background-color:rgb(=
255,255,255)"></div><br><div><div dir=3D"ltr">It would also be like having =
the hability of declaring anonymous variables.<br>It could be possible to o=
btain the same as defer if it was possible to have<br>a special variable na=
me placeholder that in truth woudn&#39;t name anything, it could<br>be auto=
?!<br><br><span style=3D"font-family:courier new,monospace">#include &lt;me=
mory&gt;<br>#include &lt;iostream&gt;<br><br>int main() {<br>=C2=A0=C2=A0=
=C2=A0 std::shared_ptr&lt;void&gt; auto(nullptr, [](...){ std::cout &lt;&lt=
; 4; });<br>=C2=A0=C2=A0=C2=A0 std::cout &lt;&lt; 1;<br><br>=C2=A0=C2=A0=C2=
=A0 std::shared_ptr&lt;void&gt; auto(nullptr, [](...){ std::cout &lt;&lt; 3=
; });<br>=C2=A0=C2=A0=C2=A0 std::cout &lt;&lt; 2;<br>}</span><br><br>Anyway=
, I&#39;d not like to disperse, just focus on the functionality.<br><br>Em =
s=C3=A1bado, 9 de julho de 2016 19:10:12 UTC-3, Francisco Lopes  escreveu:<=
blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border=
-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Ah, I just realized=
.... new keyword yeah, it&#39;s problematic to add. But I care more<br>for t=
he feature, not how it enters, so let&#39;s assume that requiring a new key=
word<br>is not a requirement in the proposal.<br><br>Em s=C3=A1bado, 9 de j=
ulho de 2016 19:01:54 UTC-3, Francisco Lopes  escreveu:<blockquote class=3D=
"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc soli=
d;padding-left:1ex"><div dir=3D"ltr">It has been some years this idea float=
s in my mind as a nice feature, so I&#39;d like<br>to ask you guys whether =
you also feel it would be helpful as I think so, it&#39;s my first proposal=
 sketch here.<br><br>I&#39;d like to suggest a new keyword, <span style=3D"=
font-family:courier new,monospace"><b>defer</b></span>, whose main purpose =
is to extend<br>the lifetime of a temporary following it, to the enclosing =
scope.<br><br>Which would help on situations like this<br><br><pre><code><s=
pan style=3D"font-family:courier new,monospace"><span>#include</span><span>=
 </span><span>&lt;memory&gt;</span><span></span><span><br>#include &lt;iost=
ream&gt;<br><br>int main() {<br>    std::shared_ptr&lt;void&gt; at_exit_1(n=
ullptr, [](...){ std::cout &lt;&lt; 4; });<br>    std::cout &lt;&lt; 1;<br>=
<br>    std::shared_ptr&lt;void&gt; at_exit_2(nullptr, [](...){ std::cout &=
lt;&lt; 3; });<br>    std::cout &lt;&lt; 2;<br>}</span></span></code><code>=
<span style=3D"font-family:courier new,monospace"><span></span><span></span=
></span><span><span style=3D"font-family:courier new,monospace"></span><br>=
<br>which could be rewritten like:<br></span></code><br><code><span><code><=
span style=3D"font-family:courier new,monospace"><span>#include</span><span=
> </span><span>&lt;memory&gt;</span><span></span><span><br>#include &lt;ios=
tream&gt;<br><br>int main() {<br>    defer std::shared_ptr&lt;void&gt;(null=
ptr, [](...){ std::cout &lt;&lt; 4; });<br>    std::cout &lt;&lt; 1;<br><br=
>    defer std::shared_ptr&lt;void&gt;(nullptr, [](...){ std::cout &lt;&lt;=
 3; });<br>    std::cout &lt;&lt; 2;<br>}</span></span></code><br><br>witho=
ut having to care for naming without necessity.<br><br>I know such kind of =
situation happen not only when using that kind of <span style=3D"font-famil=
y:courier new,monospace">at_exit</span><br>trick, but also, this is a featu=
re that couples perfectly to <span style=3D"font-family:courier new,monospa=
ce">std::lock_guard</span><br>or any kind of guard for that matter.<br><br>=
This would also have a strong connection with the <span style=3D"font-famil=
y:courier new,monospace">scope_exit &amp; unique_resource</span><br>proposa=
l.<br><br>The keyword is inspired in the <span style=3D"font-family:courier=
 new,monospace">defer</span> keyword from the Go programming language.<br><=
br>Actually, I just happened to come here after reviewing some questions on=
 StackOverflow<br>where I have had participation:<br><br>- <a href=3D"http:=
//stackoverflow.com/questions/33050620" rel=3D"nofollow" target=3D"_blank" =
onmousedown=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2=
Fstackoverflow.com%2Fquestions%2F33050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x3=
dAFQjCNFOBlSwGNeSefe01-lJ-uW5BqJ_cA&#39;;return true;" onclick=3D"this.href=
=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fque=
stions%2F33050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01-l=
J-uW5BqJ_cA&#39;;return true;">http://stackoverflow.com/<wbr>questions/3305=
0620</a><br><br>Regards,<br>Francisco Lopes<br></span></code></pre></div></=
blockquote></div></blockquote></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 rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</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/c7f9426b-47db-4760-848d-19354dd5fa82%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank" onmousedown=3D"this.href=3D&#39;https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/c7f9426b-47db-4760-848d-19354dd5fa82%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" on=
click=3D"this.href=3D&#39;https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/c7f9426b-47db-4760-848d-19354dd5fa82%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/c7f9426b-47db-4760-<wbr>848d-=
19354dd5fa82%40isocpp.org</a><wbr>.<br>
<br></div></div>
</blockquote></div></blockquote></div></blockquote></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/814e3bc4-1e5e-45eb-bcd9-e89b59580fc1%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/814e3bc4-1e5e-45eb-bcd9-e89b59580fc1=
%40isocpp.org</a>.<br />

------=_Part_1286_903530620.1468110355059--

------=_Part_1285_11244237.1468110355059--

.


Author: Francisco Lopes <francisco.mailing.lists@oblita.com>
Date: Sat, 9 Jul 2016 17:35:09 -0700 (PDT)
Raw View
------=_Part_6575_1485526966.1468110909315
Content-Type: multipart/alternative;
 boundary="----=_Part_6576_1800465173.1468110909315"

------=_Part_6576_1800465173.1468110909315
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

We may accept the subject changed to "Anonymous Variables" by now.

Em s=C3=A1bado, 9 de julho de 2016 21:25:55 UTC-3, Francisco Lopes escreveu=
:
>
> Meaning, if we ever get destructuring with a placeholder (afaik it has=20
> been explicitly excluded from
> current proposal) wouldn't it actually touch this same subject?
>
> Em s=C3=A1bado, 9 de julho de 2016 21:22:32 UTC-3, Francisco Lopes escrev=
eu:
>>
>> heh, ok. Using _ made me also connect it with the=20
>> destructuring/multiple-return proposal.
>>
>> Em s=C3=A1bado, 9 de julho de 2016 21:10:23 UTC-3, Francisco Lopes escre=
veu:
>>>
>>> I've considered (but not commented) about using _ too. It's what I empl=
oy
>>> in the referred stackoverflow link.
>>>
>>> You approach is interesting, another one that's also backwards compatib=
le
>>> is to make _ refer to the last object, overriding the previous one=20
>>> without
>>> destructing it on overriding.
>>>
>>> Em s=C3=A1bado, 9 de julho de 2016 20:30:01 UTC-3, Tony V E escreveu:
>>>>
>>>> I've been considering a feature where we could use (and reuse) _ as an=
=20
>>>> anonymous variable name.=20
>>>>
>>>> Foo _ =3D 10; //allowed today
>>>> _.member(); // ok
>>>> Bar _ =3D 5; // new - anonymous variable=E2=80=8E (both _ in scope)
>>>> _.func(); // compile failure=E2=80=8E - ambiguous _
>>>>
>>>>
>>>> Basically allow one or more variables named _.=20
>>>> If you have just one, then everything works as today (backwards=20
>>>> compatible).=20
>>>>
>>>> Once you have more than one _ variable, they all become anonymous.=20
>>>>
>>>> Sent from my BlackBerry portable Babbage Device
>>>> *From: *Francisco Lopes
>>>> *Sent: *Saturday, July 9, 2016 6:26 PM
>>>> *To: *ISO C++ Standard - Future Proposals
>>>> *Reply To: *std-pr...@isocpp.org
>>>> *Subject: *[std-proposals] Re: deferring destruction
>>>>
>>>> It would also be like having the hability of declaring anonymous=20
>>>> variables.
>>>> It could be possible to obtain the same as defer if it was possible to=
=20
>>>> have
>>>> a special variable name placeholder that in truth woudn't name=20
>>>> anything, it could
>>>> be auto?!
>>>>
>>>> #include <memory>
>>>> #include <iostream>
>>>>
>>>> int main() {
>>>>     std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 4; });
>>>>     std::cout << 1;
>>>>
>>>>     std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 3; });
>>>>     std::cout << 2;
>>>> }
>>>>
>>>> Anyway, I'd not like to disperse, just focus on the functionality.
>>>>
>>>> Em s=C3=A1bado, 9 de julho de 2016 19:10:12 UTC-3, Francisco Lopes esc=
reveu:
>>>>>
>>>>> Ah, I just realized... new keyword yeah, it's problematic to add. But=
=20
>>>>> I care more
>>>>> for the feature, not how it enters, so let's assume that requiring a=
=20
>>>>> new keyword
>>>>> is not a requirement in the proposal.
>>>>>
>>>>> Em s=C3=A1bado, 9 de julho de 2016 19:01:54 UTC-3, Francisco Lopes es=
creveu:
>>>>>>
>>>>>> It has been some years this idea floats in my mind as a nice feature=
,=20
>>>>>> so I'd like
>>>>>> to ask you guys whether you also feel it would be helpful as I think=
=20
>>>>>> so, it's my first proposal sketch here.
>>>>>>
>>>>>> I'd like to suggest a new keyword, *defer*, whose main purpose is to=
=20
>>>>>> extend
>>>>>> the lifetime of a temporary following it, to the enclosing scope.
>>>>>>
>>>>>> Which would help on situations like this
>>>>>>
>>>>>> #include <memory>
>>>>>> #include <iostream>
>>>>>>
>>>>>> int main() {
>>>>>>     std::shared_ptr<void> at_exit_1(nullptr, [](...){ std::cout << 4=
; });
>>>>>>     std::cout << 1;
>>>>>>
>>>>>>     std::shared_ptr<void> at_exit_2(nullptr, [](...){ std::cout << 3=
; });
>>>>>>     std::cout << 2;
>>>>>> }
>>>>>>
>>>>>> which could be rewritten like:
>>>>>>
>>>>>> #include <memory>
>>>>>> #include <iostream>
>>>>>>
>>>>>> int main() {
>>>>>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 4; })=
;
>>>>>>     std::cout << 1;
>>>>>>
>>>>>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 3; })=
;
>>>>>>     std::cout << 2;
>>>>>> }
>>>>>>
>>>>>> without having to care for naming without necessity.
>>>>>>
>>>>>> I know such kind of situation happen not only when using that kind o=
f at_exit
>>>>>> trick, but also, this is a feature that couples perfectly to std::lo=
ck_guard
>>>>>> or any kind of guard for that matter.
>>>>>>
>>>>>> This would also have a strong connection with the scope_exit & uniqu=
e_resource
>>>>>> proposal.
>>>>>>
>>>>>> The keyword is inspired in the defer keyword from the Go programming=
 language.
>>>>>>
>>>>>> Actually, I just happened to come here after reviewing some question=
s on StackOverflow
>>>>>> where I have had participation:
>>>>>>
>>>>>> - http://stackoverflow.com/questions/33050620
>>>>>>
>>>>>> Regards,
>>>>>> Francisco Lopes
>>>>>>
>>>>>> --=20
>>>> You received this message because you are subscribed to the Google=20
>>>> Groups "ISO C++ Standard - Future Proposals" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send=
=20
>>>> an email to std-proposal...@isocpp.org.
>>>> To post to this group, send email to std-pr...@isocpp.org.
>>>> To view this discussion on the web visit=20
>>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c7f9426b-=
47db-4760-848d-19354dd5fa82%40isocpp.org=20
>>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c7f9426b=
-47db-4760-848d-19354dd5fa82%40isocpp.org?utm_medium=3Demail&utm_source=3Df=
ooter>
>>>> .
>>>>
>>>>

--=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/a31119a7-de24-4797-9e99-d56f711e625e%40isocpp.or=
g.

------=_Part_6576_1800465173.1468110909315
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">We may accept the subject changed to &quot;Anonymous Varia=
bles&quot; by now.<br><br>Em s=C3=A1bado, 9 de julho de 2016 21:25:55 UTC-3=
, Francisco Lopes  escreveu:<blockquote class=3D"gmail_quote" style=3D"marg=
in: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><d=
iv dir=3D"ltr">Meaning, if we ever get destructuring with a placeholder (af=
aik it has been explicitly excluded from<br>current proposal) wouldn&#39;t =
it actually touch this same subject?<br><br>Em s=C3=A1bado, 9 de julho de 2=
016 21:22:32 UTC-3, Francisco Lopes  escreveu:<blockquote class=3D"gmail_qu=
ote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding=
-left:1ex"><div dir=3D"ltr">heh, ok. Using _ made me also connect it with t=
he destructuring/multiple-return proposal.<br><br>Em s=C3=A1bado, 9 de julh=
o de 2016 21:10:23 UTC-3, Francisco Lopes  escreveu:<blockquote class=3D"gm=
ail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;p=
adding-left:1ex"><div dir=3D"ltr">I&#39;ve considered (but not commented) a=
bout using _ too. It&#39;s what I employ<br>in the referred stackoverflow l=
ink.<br><br>You approach is interesting, another one that&#39;s also backwa=
rds compatible<br>is to make _ refer to the last object, overriding the pre=
vious one without<br>destructing it on overriding.<br><br>Em s=C3=A1bado, 9=
 de julho de 2016 20:30:01 UTC-3, Tony V E  escreveu:<blockquote class=3D"g=
mail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div style=3D"background-color:rgb(255,255,255);line-heig=
ht:initial" lang=3D"en-US">                                                =
                                      <div style=3D"width:100%;font-size:in=
itial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:r=
gb(31,73,125);text-align:initial;background-color:rgb(255,255,255)">I&#39;v=
e been considering a feature where we could use (and reuse) _ as an anonymo=
us variable name.=C2=A0</div><div style=3D"width:100%;font-size:initial;fon=
t-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 s=
tyle=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)">Foo _ =3D 10; //allowed today</div><div style=3D"wi=
dth:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-ser=
if,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(=
255,255,255)">_.member(); // ok</div><div style=3D"width:100%;font-size:ini=
tial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rg=
b(31,73,125);text-align:initial;background-color:rgb(255,255,255)">Bar _ =
=3D 5; // new - anonymous variable<span style=3D"font-size:initial;text-ali=
gn:initial;line-height:initial">=E2=80=8E (both _ in scope)</span></div><di=
v 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;backgrou=
nd-color:rgb(255,255,255)">_.func(); // compile failure=E2=80=8E - ambiguou=
s _</div><div style=3D"width:100%;font-size:initial;font-family:Calibri,&#3=
9;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:init=
ial;background-color:rgb(255,255,255)"><span style=3D"font-size:initial;lin=
e-height:initial;text-align:initial"><br></span></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)"><span style=3D"font-size:initial;line-height:initial;text-align:in=
itial"><br></span></div><div style=3D"width:100%;font-size:initial;font-fam=
ily:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);=
text-align:initial;background-color:rgb(255,255,255)">Basically allow one o=
r more variables named _.=C2=A0</div><div style=3D"width:100%;font-size:ini=
tial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rg=
b(31,73,125);text-align:initial;background-color:rgb(255,255,255)">If you h=
ave just one, then everything works as today (backwards compatible).=C2=A0<=
/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)"><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)">=
Once you have more than one _ variable, they all become anonymous. </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;S=
late 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>                         =
                                                                           =
                                                                           =
   <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:initi=
al;background-color:rgb(255,255,255)">                           <div style=
=3D"border-style:solid none none;border-top-color:rgb(181,196,223);border-t=
op-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>Francisco Lopes</d=
iv><div><b>Sent: </b>Saturday, July 9, 2016 6:26 PM</div><div><b>To: </b>IS=
O C++ Standard - Future Proposals</div><div><b>Reply To: </b><a rel=3D"nofo=
llow">std-pr...@isocpp.org</a></div><div><b>Subject: </b>[std-proposals] Re=
: deferring destruction</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(255,255,=
255)"></div><br><div><div dir=3D"ltr">It would also be like having the habi=
lity of declaring anonymous variables.<br>It could be possible to obtain th=
e same as defer if it was possible to have<br>a special variable name place=
holder that in truth woudn&#39;t name anything, it could<br>be auto?!<br><b=
r><span style=3D"font-family:courier new,monospace">#include &lt;memory&gt;=
<br>#include &lt;iostream&gt;<br><br>int main() {<br>=C2=A0=C2=A0=C2=A0 std=
::shared_ptr&lt;void&gt; auto(nullptr, [](...){ std::cout &lt;&lt; 4; });<b=
r>=C2=A0=C2=A0=C2=A0 std::cout &lt;&lt; 1;<br><br>=C2=A0=C2=A0=C2=A0 std::s=
hared_ptr&lt;void&gt; auto(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>=
=C2=A0=C2=A0=C2=A0 std::cout &lt;&lt; 2;<br>}</span><br><br>Anyway, I&#39;d=
 not like to disperse, just focus on the functionality.<br><br>Em s=C3=A1ba=
do, 9 de julho de 2016 19:10:12 UTC-3, Francisco Lopes  escreveu:<blockquot=
e class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px=
 #ccc solid;padding-left:1ex"><div dir=3D"ltr">Ah, I just realized... new k=
eyword yeah, it&#39;s problematic to add. But I care more<br>for the featur=
e, not how it enters, so let&#39;s assume that requiring a new keyword<br>i=
s not a requirement in the proposal.<br><br>Em s=C3=A1bado, 9 de julho de 2=
016 19:01:54 UTC-3, Francisco Lopes  escreveu:<blockquote class=3D"gmail_qu=
ote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding=
-left:1ex"><div dir=3D"ltr">It has been some years this idea floats in my m=
ind as a nice feature, so I&#39;d like<br>to ask you guys whether you also =
feel it would be helpful as I think so, it&#39;s my first proposal sketch h=
ere.<br><br>I&#39;d like to suggest a new keyword, <span style=3D"font-fami=
ly:courier new,monospace"><b>defer</b></span>, whose main purpose is to ext=
end<br>the lifetime of a temporary following it, to the enclosing scope.<br=
><br>Which would help on situations like this<br><br><pre><code><span style=
=3D"font-family:courier new,monospace"><span>#include</span><span> </span><=
span>&lt;memory&gt;</span><span></span><span><br>#include &lt;iostream&gt;<=
br><br>int main() {<br>    std::shared_ptr&lt;void&gt; at_exit_1(nullptr, [=
](...){ std::cout &lt;&lt; 4; });<br>    std::cout &lt;&lt; 1;<br><br>    s=
td::shared_ptr&lt;void&gt; at_exit_2(nullptr, [](...){ std::cout &lt;&lt; 3=
; });<br>    std::cout &lt;&lt; 2;<br>}</span></span></code><code><span sty=
le=3D"font-family:courier new,monospace"><span></span><span></span></span><=
span><span style=3D"font-family:courier new,monospace"></span><br><br>which=
 could be rewritten like:<br></span></code><br><code><span><code><span styl=
e=3D"font-family:courier new,monospace"><span>#include</span><span> </span>=
<span>&lt;memory&gt;</span><span></span><span><br>#include &lt;iostream&gt;=
<br><br>int main() {<br>    defer std::shared_ptr&lt;void&gt;(nullptr, [](.=
...){ std::cout &lt;&lt; 4; });<br>    std::cout &lt;&lt; 1;<br><br>    defe=
r std::shared_ptr&lt;void&gt;(nullptr, [](...){ std::cout &lt;&lt; 3; });<b=
r>    std::cout &lt;&lt; 2;<br>}</span></span></code><br><br>without having=
 to care for naming without necessity.<br><br>I know such kind of situation=
 happen not only when using that kind of <span style=3D"font-family:courier=
 new,monospace">at_exit</span><br>trick, but also, this is a feature that c=
ouples perfectly to <span style=3D"font-family:courier new,monospace">std::=
lock_guard</span><br>or any kind of guard for that matter.<br><br>This woul=
d also have a strong connection with the <span style=3D"font-family:courier=
 new,monospace">scope_exit &amp; unique_resource</span><br>proposal.<br><br=
>The keyword is inspired in the <span style=3D"font-family:courier new,mono=
space">defer</span> keyword from the Go programming language.<br><br>Actual=
ly, I just happened to come here after reviewing some questions on StackOve=
rflow<br>where I have had participation:<br><br>- <a href=3D"http://stackov=
erflow.com/questions/33050620" rel=3D"nofollow" target=3D"_blank" onmousedo=
wn=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackove=
rflow.com%2Fquestions%2F33050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFO=
BlSwGNeSefe01-lJ-uW5BqJ_cA&#39;;return true;" onclick=3D"this.href=3D&#39;h=
ttp://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F=
33050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01-lJ-uW5BqJ_=
cA&#39;;return true;">http://stackoverflow.com/<wbr>questions/33050620</a><=
br><br>Regards,<br>Francisco Lopes<br></span></code></pre></div></blockquot=
e></div></blockquote></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 rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</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/c7f9426b-47db-4760-848d-19354dd5fa82%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank" onmousedown=3D"this.href=3D&#39;https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/c7f9426b-47db-4760-848d-19354dd5fa82%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" on=
click=3D"this.href=3D&#39;https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/c7f9426b-47db-4760-848d-19354dd5fa82%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/c7f9426b-47db-4760-<wbr>848d-=
19354dd5fa82%40isocpp.org</a><wbr>.<br>
<br></div></div>
</blockquote></div></blockquote></div></blockquote></div></blockquote></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/a31119a7-de24-4797-9e99-d56f711e625e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/a31119a7-de24-4797-9e99-d56f711e625e=
%40isocpp.org</a>.<br />

------=_Part_6576_1800465173.1468110909315--

------=_Part_6575_1485526966.1468110909315--

.


Author: Francisco Lopes <francisco.mailing.lists@oblita.com>
Date: Sat, 9 Jul 2016 17:41:08 -0700 (PDT)
Raw View
------=_Part_513_283179545.1468111268658
Content-Type: multipart/alternative;
 boundary="----=_Part_514_1889047935.1468111268659"

------=_Part_514_1889047935.1468111268659
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

By initially searching deferred destruction I coudn't find anything, but=20
anonymous variables give the following
old topics:

-=20
https://groups.google.com/a/isocpp.org/d/msg/std-proposals/GJ-3seXeIl4/bS-O=
_9rnZosJ
-=20
https://groups.google.com/a/isocpp.org/d/msg/std-proposals/BfAtczj81Kg/pga0=
JJ2JijwJ

Em s=C3=A1bado, 9 de julho de 2016 21:35:09 UTC-3, Francisco Lopes escreveu=
:
>
> We may accept the subject changed to "Anonymous Variables" by now.
>
> Em s=C3=A1bado, 9 de julho de 2016 21:25:55 UTC-3, Francisco Lopes escrev=
eu:
>>
>> Meaning, if we ever get destructuring with a placeholder (afaik it has=
=20
>> been explicitly excluded from
>> current proposal) wouldn't it actually touch this same subject?
>>
>> Em s=C3=A1bado, 9 de julho de 2016 21:22:32 UTC-3, Francisco Lopes escre=
veu:
>>>
>>> heh, ok. Using _ made me also connect it with the=20
>>> destructuring/multiple-return proposal.
>>>
>>> Em s=C3=A1bado, 9 de julho de 2016 21:10:23 UTC-3, Francisco Lopes escr=
eveu:
>>>>
>>>> I've considered (but not commented) about using _ too. It's what I=20
>>>> employ
>>>> in the referred stackoverflow link.
>>>>
>>>> You approach is interesting, another one that's also backwards=20
>>>> compatible
>>>> is to make _ refer to the last object, overriding the previous one=20
>>>> without
>>>> destructing it on overriding.
>>>>
>>>> Em s=C3=A1bado, 9 de julho de 2016 20:30:01 UTC-3, Tony V E escreveu:
>>>>>
>>>>> I've been considering a feature where we could use (and reuse) _ as a=
n=20
>>>>> anonymous variable name.=20
>>>>>
>>>>> Foo _ =3D 10; //allowed today
>>>>> _.member(); // ok
>>>>> Bar _ =3D 5; // new - anonymous variable=E2=80=8E (both _ in scope)
>>>>> _.func(); // compile failure=E2=80=8E - ambiguous _
>>>>>
>>>>>
>>>>> Basically allow one or more variables named _.=20
>>>>> If you have just one, then everything works as today (backwards=20
>>>>> compatible).=20
>>>>>
>>>>> Once you have more than one _ variable, they all become anonymous.=20
>>>>>
>>>>> Sent from my BlackBerry portable Babbage Device
>>>>> *From: *Francisco Lopes
>>>>> *Sent: *Saturday, July 9, 2016 6:26 PM
>>>>> *To: *ISO C++ Standard - Future Proposals
>>>>> *Reply To: *std-pr...@isocpp.org
>>>>> *Subject: *[std-proposals] Re: deferring destruction
>>>>>
>>>>> It would also be like having the hability of declaring anonymous=20
>>>>> variables.
>>>>> It could be possible to obtain the same as defer if it was possible t=
o=20
>>>>> have
>>>>> a special variable name placeholder that in truth woudn't name=20
>>>>> anything, it could
>>>>> be auto?!
>>>>>
>>>>> #include <memory>
>>>>> #include <iostream>
>>>>>
>>>>> int main() {
>>>>>     std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 4; });
>>>>>     std::cout << 1;
>>>>>
>>>>>     std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 3; });
>>>>>     std::cout << 2;
>>>>> }
>>>>>
>>>>> Anyway, I'd not like to disperse, just focus on the functionality.
>>>>>
>>>>> Em s=C3=A1bado, 9 de julho de 2016 19:10:12 UTC-3, Francisco Lopes es=
creveu:
>>>>>>
>>>>>> Ah, I just realized... new keyword yeah, it's problematic to add. Bu=
t=20
>>>>>> I care more
>>>>>> for the feature, not how it enters, so let's assume that requiring a=
=20
>>>>>> new keyword
>>>>>> is not a requirement in the proposal.
>>>>>>
>>>>>> Em s=C3=A1bado, 9 de julho de 2016 19:01:54 UTC-3, Francisco Lopes=
=20
>>>>>> escreveu:
>>>>>>>
>>>>>>> It has been some years this idea floats in my mind as a nice=20
>>>>>>> feature, so I'd like
>>>>>>> to ask you guys whether you also feel it would be helpful as I thin=
k=20
>>>>>>> so, it's my first proposal sketch here.
>>>>>>>
>>>>>>> I'd like to suggest a new keyword, *defer*, whose main purpose is=
=20
>>>>>>> to extend
>>>>>>> the lifetime of a temporary following it, to the enclosing scope.
>>>>>>>
>>>>>>> Which would help on situations like this
>>>>>>>
>>>>>>> #include <memory>
>>>>>>> #include <iostream>
>>>>>>>
>>>>>>> int main() {
>>>>>>>     std::shared_ptr<void> at_exit_1(nullptr, [](...){ std::cout << =
4; });
>>>>>>>     std::cout << 1;
>>>>>>>
>>>>>>>     std::shared_ptr<void> at_exit_2(nullptr, [](...){ std::cout << =
3; });
>>>>>>>     std::cout << 2;
>>>>>>> }
>>>>>>>
>>>>>>> which could be rewritten like:
>>>>>>>
>>>>>>> #include <memory>
>>>>>>> #include <iostream>
>>>>>>>
>>>>>>> int main() {
>>>>>>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 4; }=
);
>>>>>>>     std::cout << 1;
>>>>>>>
>>>>>>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 3; }=
);
>>>>>>>     std::cout << 2;
>>>>>>> }
>>>>>>>
>>>>>>> without having to care for naming without necessity.
>>>>>>>
>>>>>>> I know such kind of situation happen not only when using that kind =
of at_exit
>>>>>>> trick, but also, this is a feature that couples perfectly to std::l=
ock_guard
>>>>>>> or any kind of guard for that matter.
>>>>>>>
>>>>>>> This would also have a strong connection with the scope_exit & uniq=
ue_resource
>>>>>>> proposal.
>>>>>>>
>>>>>>> The keyword is inspired in the defer keyword from the Go programmin=
g language.
>>>>>>>
>>>>>>> Actually, I just happened to come here after reviewing some questio=
ns on StackOverflow
>>>>>>> where I have had participation:
>>>>>>>
>>>>>>> - http://stackoverflow.com/questions/33050620
>>>>>>>
>>>>>>> Regards,
>>>>>>> Francisco Lopes
>>>>>>>
>>>>>>> --=20
>>>>> You received this message because you are subscribed to the Google=20
>>>>> Groups "ISO C++ Standard - Future Proposals" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, sen=
d=20
>>>>> an email to std-proposal...@isocpp.org.
>>>>> To post to this group, send email to std-pr...@isocpp.org.
>>>>> To view this discussion on the web visit=20
>>>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c7f9426b=
-47db-4760-848d-19354dd5fa82%40isocpp.org=20
>>>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c7f9426=
b-47db-4760-848d-19354dd5fa82%40isocpp.org?utm_medium=3Demail&utm_source=3D=
footer>
>>>>> .
>>>>>
>>>>>

--=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/96413d02-2b12-46ab-872e-d7fbfcb2dbdc%40isocpp.or=
g.

------=_Part_514_1889047935.1468111268659
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">By initially searching deferred destruction I coudn&#39;t =
find anything, but anonymous variables give the following<br>old topics:<br=
><br>- <a href=3D"https://groups.google.com/a/isocpp.org/d/msg/std-proposal=
s/GJ-3seXeIl4/bS-O_9rnZosJ">https://groups.google.com/a/isocpp.org/d/msg/st=
d-proposals/GJ-3seXeIl4/bS-O_9rnZosJ</a><br>- <a href=3D"https://groups.goo=
gle.com/a/isocpp.org/d/msg/std-proposals/BfAtczj81Kg/pga0JJ2JijwJ">https://=
groups.google.com/a/isocpp.org/d/msg/std-proposals/BfAtczj81Kg/pga0JJ2JijwJ=
</a><br><br>Em s=C3=A1bado, 9 de julho de 2016 21:35:09 UTC-3, Francisco Lo=
pes  escreveu:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-l=
eft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"=
>We may accept the subject changed to &quot;Anonymous Variables&quot; by no=
w.<br><br>Em s=C3=A1bado, 9 de julho de 2016 21:25:55 UTC-3, Francisco Lope=
s  escreveu:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left=
:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Meanin=
g, if we ever get destructuring with a placeholder (afaik it has been expli=
citly excluded from<br>current proposal) wouldn&#39;t it actually touch thi=
s same subject?<br><br>Em s=C3=A1bado, 9 de julho de 2016 21:22:32 UTC-3, F=
rancisco Lopes  escreveu:<blockquote class=3D"gmail_quote" style=3D"margin:=
0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr">heh, ok. Using _ made me also connect it with the destructuring/mu=
ltiple-return proposal.<br><br>Em s=C3=A1bado, 9 de julho de 2016 21:10:23 =
UTC-3, Francisco Lopes  escreveu:<blockquote class=3D"gmail_quote" style=3D=
"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><d=
iv dir=3D"ltr">I&#39;ve considered (but not commented) about using _ too. I=
t&#39;s what I employ<br>in the referred stackoverflow link.<br><br>You app=
roach is interesting, another one that&#39;s also backwards compatible<br>i=
s to make _ refer to the last object, overriding the previous one without<b=
r>destructing it on overriding.<br><br>Em s=C3=A1bado, 9 de julho de 2016 2=
0:30:01 UTC-3, Tony V E  escreveu:<blockquote class=3D"gmail_quote" style=
=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"=
><div style=3D"background-color:rgb(255,255,255);line-height:initial" lang=
=3D"en-US">                                                                =
                      <div style=3D"width:100%;font-size:initial;font-famil=
y:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);te=
xt-align:initial;background-color:rgb(255,255,255)">I&#39;ve been consideri=
ng a feature where we could use (and reuse) _ as an anonymous variable name=
..=C2=A0</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: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)">Foo _ =3D 10; //allowed today</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)">_.=
member(); // ok</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);tex=
t-align:initial;background-color:rgb(255,255,255)">Bar _ =3D 5; // new - an=
onymous variable<span style=3D"font-size:initial;text-align:initial;line-he=
ight:initial">=E2=80=8E (both _ in scope)</span></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)">_.func(); // compile failure=E2=80=8E - ambiguous _</div><div styl=
e=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,s=
ans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-col=
or:rgb(255,255,255)"><span style=3D"font-size:initial;line-height:initial;t=
ext-align:initial"><br></span></div><div style=3D"width:100%;font-size:init=
ial;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)"><span sty=
le=3D"font-size:initial;line-height:initial;text-align:initial"><br></span>=
</div><div style=3D"width:100%;font-size:initial;font-family:Calibri,&#39;S=
late Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial=
;background-color:rgb(255,255,255)">Basically allow one or more variables n=
amed _.=C2=A0</div><div style=3D"width:100%;font-size:initial;font-family:C=
alibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-=
align:initial;background-color:rgb(255,255,255)">If you have just one, then=
 everything works as today (backwards compatible).=C2=A0</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:r=
gb(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,12=
5);text-align:initial;background-color:rgb(255,255,255)">Once you have more=
 than one _ variable, they all become anonymous. </div>                    =
                                                                           =
                                      <div style=3D"width:100%;font-size:in=
itial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:r=
gb(31,73,125);text-align:initial;background-color:rgb(255,255,255)"><br sty=
le=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;background-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 c=
olspan=3D"2" style=3D"font-size:initial;text-align:initial;background-color=
:rgb(255,255,255)">                           <div style=3D"border-style:so=
lid none none;border-top-color:rgb(181,196,223);border-top-width:1pt;paddin=
g:3pt 0in 0in;font-family:Tahoma,&#39;BB Alpha Sans&#39;,&#39;Slate Pro&#39=
;;font-size:10pt">  <div><b>From: </b>Francisco Lopes</div><div><b>Sent: </=
b>Saturday, July 9, 2016 6:26 PM</div><div><b>To: </b>ISO C++ Standard - Fu=
ture Proposals</div><div><b>Reply To: </b><a rel=3D"nofollow">std-pr...@iso=
cpp.org</a></div><div><b>Subject: </b>[std-proposals] Re: deferring destruc=
tion</div></div></td></tr></tbody></table><div style=3D"border-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><di=
v><div dir=3D"ltr">It would also be like having the hability of declaring a=
nonymous variables.<br>It could be possible to obtain the same as defer if =
it was possible to have<br>a special variable name placeholder that in trut=
h woudn&#39;t name anything, it could<br>be auto?!<br><br><span style=3D"fo=
nt-family:courier new,monospace">#include &lt;memory&gt;<br>#include &lt;io=
stream&gt;<br><br>int main() {<br>=C2=A0=C2=A0=C2=A0 std::shared_ptr&lt;voi=
d&gt; auto(nullptr, [](...){ std::cout &lt;&lt; 4; });<br>=C2=A0=C2=A0=C2=
=A0 std::cout &lt;&lt; 1;<br><br>=C2=A0=C2=A0=C2=A0 std::shared_ptr&lt;void=
&gt; auto(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>=C2=A0=C2=A0=C2=A0=
 std::cout &lt;&lt; 2;<br>}</span><br><br>Anyway, I&#39;d not like to dispe=
rse, just focus on the functionality.<br><br>Em s=C3=A1bado, 9 de julho de =
2016 19:10:12 UTC-3, Francisco Lopes  escreveu:<blockquote class=3D"gmail_q=
uote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;paddin=
g-left:1ex"><div dir=3D"ltr">Ah, I just realized... new keyword yeah, it&#3=
9;s problematic to add. But I care more<br>for the feature, not how it ente=
rs, so let&#39;s assume that requiring a new keyword<br>is not a requiremen=
t in the proposal.<br><br>Em s=C3=A1bado, 9 de julho de 2016 19:01:54 UTC-3=
, Francisco Lopes  escreveu:<blockquote class=3D"gmail_quote" style=3D"marg=
in:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div di=
r=3D"ltr">It has been some years this idea floats in my mind as a nice feat=
ure, so I&#39;d like<br>to ask you guys whether you also feel it would be h=
elpful as I think so, it&#39;s my first proposal sketch here.<br><br>I&#39;=
d like to suggest a new keyword, <span style=3D"font-family:courier new,mon=
ospace"><b>defer</b></span>, whose main purpose is to extend<br>the lifetim=
e of a temporary following it, to the enclosing scope.<br><br>Which would h=
elp on situations like this<br><br><pre><code><span style=3D"font-family:co=
urier new,monospace"><span>#include</span><span> </span><span>&lt;memory&gt=
;</span><span></span><span><br>#include &lt;iostream&gt;<br><br>int main() =
{<br>    std::shared_ptr&lt;void&gt; at_exit_1(nullptr, [](...){ std::cout =
&lt;&lt; 4; });<br>    std::cout &lt;&lt; 1;<br><br>    std::shared_ptr&lt;=
void&gt; at_exit_2(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>    std::=
cout &lt;&lt; 2;<br>}</span></span></code><code><span style=3D"font-family:=
courier new,monospace"><span></span><span></span></span><span><span style=
=3D"font-family:courier new,monospace"></span><br><br>which could be rewrit=
ten like:<br></span></code><br><code><span><code><span style=3D"font-family=
:courier new,monospace"><span>#include</span><span> </span><span>&lt;memory=
&gt;</span><span></span><span><br>#include &lt;iostream&gt;<br><br>int main=
() {<br>    defer std::shared_ptr&lt;void&gt;(nullptr, [](...){ std::cout &=
lt;&lt; 4; });<br>    std::cout &lt;&lt; 1;<br><br>    defer std::shared_pt=
r&lt;void&gt;(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>    std::cout =
&lt;&lt; 2;<br>}</span></span></code><br><br>without having to care for nam=
ing without necessity.<br><br>I know such kind of situation happen not only=
 when using that kind of <span style=3D"font-family:courier new,monospace">=
at_exit</span><br>trick, but also, this is a feature that couples perfectly=
 to <span style=3D"font-family:courier new,monospace">std::lock_guard</span=
><br>or any kind of guard for that matter.<br><br>This would also have a st=
rong connection with the <span style=3D"font-family:courier new,monospace">=
scope_exit &amp; unique_resource</span><br>proposal.<br><br>The keyword is =
inspired in the <span style=3D"font-family:courier new,monospace">defer</sp=
an> keyword from the Go programming language.<br><br>Actually, I just happe=
ned to come here after reviewing some questions on StackOverflow<br>where I=
 have had participation:<br><br>- <a href=3D"http://stackoverflow.com/quest=
ions/33050620" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=
=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fque=
stions%2F33050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01-l=
J-uW5BqJ_cA&#39;;return true;" onclick=3D"this.href=3D&#39;http://www.googl=
e.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F33050620\x26sa\=
x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01-lJ-uW5BqJ_cA&#39;;return =
true;">http://stackoverflow.com/<wbr>questions/33050620</a><br><br>Regards,=
<br>Francisco Lopes<br></span></code></pre></div></blockquote></div></block=
quote></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 rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</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/c7f9426b-47db-4760-848d-19354dd5fa82%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank" onmousedown=3D"this.href=3D&#39;https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/c7f9426b-47db-4760-848d-19354dd5fa82%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" on=
click=3D"this.href=3D&#39;https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/c7f9426b-47db-4760-848d-19354dd5fa82%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/c7f9426b-47db-4760-<wbr>848d-=
19354dd5fa82%40isocpp.org</a><wbr>.<br>
<br></div></div>
</blockquote></div></blockquote></div></blockquote></div></blockquote></div=
></blockquote></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/96413d02-2b12-46ab-872e-d7fbfcb2dbdc%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/96413d02-2b12-46ab-872e-d7fbfcb2dbdc=
%40isocpp.org</a>.<br />

------=_Part_514_1889047935.1468111268659--

------=_Part_513_283179545.1468111268658--

.


Author: Francisco Lopes <francisco.mailing.lists@oblita.com>
Date: Sat, 9 Jul 2016 17:51:41 -0700 (PDT)
Raw View
------=_Part_2147_2024327089.1468111901507
Content-Type: multipart/alternative;
 boundary="----=_Part_2148_840145629.1468111901508"

------=_Part_2148_840145629.1468111901508
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

To sum the arguments in favor of the proposal for today, compared to the=20
fewer usecases presented years back:

Having anonymous variables would:

- Improve ergonomics for multiple return and destructuring.
- Improve ergonomics for any kind of scope guards.
- Improve ergonomics for scope_exit usage.

Em s=C3=A1bado, 9 de julho de 2016 21:41:09 UTC-3, Francisco Lopes escreveu=
:
>
> By initially searching deferred destruction I coudn't find anything, but=
=20
> anonymous variables give the following
> old topics:
>
> -=20
> https://groups.google.com/a/isocpp.org/d/msg/std-proposals/GJ-3seXeIl4/bS=
-O_9rnZosJ
> -=20
> https://groups.google.com/a/isocpp.org/d/msg/std-proposals/BfAtczj81Kg/pg=
a0JJ2JijwJ
>
> Em s=C3=A1bado, 9 de julho de 2016 21:35:09 UTC-3, Francisco Lopes escrev=
eu:
>>
>> We may accept the subject changed to "Anonymous Variables" by now.
>>
>> Em s=C3=A1bado, 9 de julho de 2016 21:25:55 UTC-3, Francisco Lopes escre=
veu:
>>>
>>> Meaning, if we ever get destructuring with a placeholder (afaik it has=
=20
>>> been explicitly excluded from
>>> current proposal) wouldn't it actually touch this same subject?
>>>
>>> Em s=C3=A1bado, 9 de julho de 2016 21:22:32 UTC-3, Francisco Lopes escr=
eveu:
>>>>
>>>> heh, ok. Using _ made me also connect it with the=20
>>>> destructuring/multiple-return proposal.
>>>>
>>>> Em s=C3=A1bado, 9 de julho de 2016 21:10:23 UTC-3, Francisco Lopes esc=
reveu:
>>>>>
>>>>> I've considered (but not commented) about using _ too. It's what I=20
>>>>> employ
>>>>> in the referred stackoverflow link.
>>>>>
>>>>> You approach is interesting, another one that's also backwards=20
>>>>> compatible
>>>>> is to make _ refer to the last object, overriding the previous one=20
>>>>> without
>>>>> destructing it on overriding.
>>>>>
>>>>> Em s=C3=A1bado, 9 de julho de 2016 20:30:01 UTC-3, Tony V E escreveu:
>>>>>>
>>>>>> I've been considering a feature where we could use (and reuse) _ as=
=20
>>>>>> an anonymous variable name.=20
>>>>>>
>>>>>> Foo _ =3D 10; //allowed today
>>>>>> _.member(); // ok
>>>>>> Bar _ =3D 5; // new - anonymous variable=E2=80=8E (both _ in scope)
>>>>>> _.func(); // compile failure=E2=80=8E - ambiguous _
>>>>>>
>>>>>>
>>>>>> Basically allow one or more variables named _.=20
>>>>>> If you have just one, then everything works as today (backwards=20
>>>>>> compatible).=20
>>>>>>
>>>>>> Once you have more than one _ variable, they all become anonymous.=
=20
>>>>>>
>>>>>> Sent from my BlackBerry portable Babbage Device
>>>>>> *From: *Francisco Lopes
>>>>>> *Sent: *Saturday, July 9, 2016 6:26 PM
>>>>>> *To: *ISO C++ Standard - Future Proposals
>>>>>> *Reply To: *std-pr...@isocpp.org
>>>>>> *Subject: *[std-proposals] Re: deferring destruction
>>>>>>
>>>>>> It would also be like having the hability of declaring anonymous=20
>>>>>> variables.
>>>>>> It could be possible to obtain the same as defer if it was possible=
=20
>>>>>> to have
>>>>>> a special variable name placeholder that in truth woudn't name=20
>>>>>> anything, it could
>>>>>> be auto?!
>>>>>>
>>>>>> #include <memory>
>>>>>> #include <iostream>
>>>>>>
>>>>>> int main() {
>>>>>>     std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 4; });
>>>>>>     std::cout << 1;
>>>>>>
>>>>>>     std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 3; });
>>>>>>     std::cout << 2;
>>>>>> }
>>>>>>
>>>>>> Anyway, I'd not like to disperse, just focus on the functionality.
>>>>>>
>>>>>> Em s=C3=A1bado, 9 de julho de 2016 19:10:12 UTC-3, Francisco Lopes=
=20
>>>>>> escreveu:
>>>>>>>
>>>>>>> Ah, I just realized... new keyword yeah, it's problematic to add.=
=20
>>>>>>> But I care more
>>>>>>> for the feature, not how it enters, so let's assume that requiring =
a=20
>>>>>>> new keyword
>>>>>>> is not a requirement in the proposal.
>>>>>>>
>>>>>>> Em s=C3=A1bado, 9 de julho de 2016 19:01:54 UTC-3, Francisco Lopes=
=20
>>>>>>> escreveu:
>>>>>>>>
>>>>>>>> It has been some years this idea floats in my mind as a nice=20
>>>>>>>> feature, so I'd like
>>>>>>>> to ask you guys whether you also feel it would be helpful as I=20
>>>>>>>> think so, it's my first proposal sketch here.
>>>>>>>>
>>>>>>>> I'd like to suggest a new keyword, *defer*, whose main purpose is=
=20
>>>>>>>> to extend
>>>>>>>> the lifetime of a temporary following it, to the enclosing scope.
>>>>>>>>
>>>>>>>> Which would help on situations like this
>>>>>>>>
>>>>>>>> #include <memory>
>>>>>>>> #include <iostream>
>>>>>>>>
>>>>>>>> int main() {
>>>>>>>>     std::shared_ptr<void> at_exit_1(nullptr, [](...){ std::cout <<=
 4; });
>>>>>>>>     std::cout << 1;
>>>>>>>>
>>>>>>>>     std::shared_ptr<void> at_exit_2(nullptr, [](...){ std::cout <<=
 3; });
>>>>>>>>     std::cout << 2;
>>>>>>>> }
>>>>>>>>
>>>>>>>> which could be rewritten like:
>>>>>>>>
>>>>>>>> #include <memory>
>>>>>>>> #include <iostream>
>>>>>>>>
>>>>>>>> int main() {
>>>>>>>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 4; =
});
>>>>>>>>     std::cout << 1;
>>>>>>>>
>>>>>>>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 3; =
});
>>>>>>>>     std::cout << 2;
>>>>>>>> }
>>>>>>>>
>>>>>>>> without having to care for naming without necessity.
>>>>>>>>
>>>>>>>> I know such kind of situation happen not only when using that kind=
 of at_exit
>>>>>>>> trick, but also, this is a feature that couples perfectly to std::=
lock_guard
>>>>>>>> or any kind of guard for that matter.
>>>>>>>>
>>>>>>>> This would also have a strong connection with the scope_exit & uni=
que_resource
>>>>>>>> proposal.
>>>>>>>>
>>>>>>>> The keyword is inspired in the defer keyword from the Go programmi=
ng language.
>>>>>>>>
>>>>>>>> Actually, I just happened to come here after reviewing some questi=
ons on StackOverflow
>>>>>>>> where I have had participation:
>>>>>>>>
>>>>>>>> - http://stackoverflow.com/questions/33050620
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>> Francisco Lopes
>>>>>>>>
>>>>>>>> --=20
>>>>>> You received this message because you are subscribed to the Google=
=20
>>>>>> Groups "ISO C++ Standard - Future Proposals" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,=20
>>>>>> send an email to std-proposal...@isocpp.org.
>>>>>> To post to this group, send email to std-pr...@isocpp.org.
>>>>>> To view this discussion on the web visit=20
>>>>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c7f9426=
b-47db-4760-848d-19354dd5fa82%40isocpp.org=20
>>>>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c7f942=
6b-47db-4760-848d-19354dd5fa82%40isocpp.org?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/bc87f72c-6cd2-4d75-afd8-1af5310b5508%40isocpp.or=
g.

------=_Part_2148_840145629.1468111901508
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">To sum the arguments in favor of the proposal for today, c=
ompared to the fewer usecases presented years back:<br><br>Having anonymous=
 variables would:<br><br>- Improve ergonomics for multiple return and destr=
ucturing.<br>- Improve ergonomics for any kind of scope guards.<br>- Improv=
e ergonomics for scope_exit usage.<br><br>Em s=C3=A1bado, 9 de julho de 201=
6 21:41:09 UTC-3, Francisco Lopes  escreveu:<blockquote class=3D"gmail_quot=
e" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;paddin=
g-left: 1ex;"><div dir=3D"ltr">By initially searching deferred destruction =
I coudn&#39;t find anything, but anonymous variables give the following<br>=
old topics:<br><br>- <a href=3D"https://groups.google.com/a/isocpp.org/d/ms=
g/std-proposals/GJ-3seXeIl4/bS-O_9rnZosJ" target=3D"_blank" rel=3D"nofollow=
" onmousedown=3D"this.href=3D&#39;https://groups.google.com/a/isocpp.org/d/=
msg/std-proposals/GJ-3seXeIl4/bS-O_9rnZosJ&#39;;return true;" onclick=3D"th=
is.href=3D&#39;https://groups.google.com/a/isocpp.org/d/msg/std-proposals/G=
J-3seXeIl4/bS-O_9rnZosJ&#39;;return true;">https://groups.google.com/a/<wbr=
>isocpp.org/d/msg/std-<wbr>proposals/GJ-3seXeIl4/bS-O_<wbr>9rnZosJ</a><br>-=
 <a href=3D"https://groups.google.com/a/isocpp.org/d/msg/std-proposals/BfAt=
czj81Kg/pga0JJ2JijwJ" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"thi=
s.href=3D&#39;https://groups.google.com/a/isocpp.org/d/msg/std-proposals/Bf=
Atczj81Kg/pga0JJ2JijwJ&#39;;return true;" onclick=3D"this.href=3D&#39;https=
://groups.google.com/a/isocpp.org/d/msg/std-proposals/BfAtczj81Kg/pga0JJ2Ji=
jwJ&#39;;return true;">https://groups.google.com/a/<wbr>isocpp.org/d/msg/st=
d-<wbr>proposals/BfAtczj81Kg/<wbr>pga0JJ2JijwJ</a><br><br>Em s=C3=A1bado, 9=
 de julho de 2016 21:35:09 UTC-3, Francisco Lopes  escreveu:<blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc=
 solid;padding-left:1ex"><div dir=3D"ltr">We may accept the subject changed=
 to &quot;Anonymous Variables&quot; by now.<br><br>Em s=C3=A1bado, 9 de jul=
ho de 2016 21:25:55 UTC-3, Francisco Lopes  escreveu:<blockquote class=3D"g=
mail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div dir=3D"ltr">Meaning, if we ever get destructuring wi=
th a placeholder (afaik it has been explicitly excluded from<br>current pro=
posal) wouldn&#39;t it actually touch this same subject?<br><br>Em s=C3=A1b=
ado, 9 de julho de 2016 21:22:32 UTC-3, Francisco Lopes  escreveu:<blockquo=
te class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">heh, ok. Using _ made me al=
so connect it with the destructuring/multiple-return proposal.<br><br>Em s=
=C3=A1bado, 9 de julho de 2016 21:10:23 UTC-3, Francisco Lopes  escreveu:<b=
lockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-=
left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">I&#39;ve considered =
(but not commented) about using _ too. It&#39;s what I employ<br>in the ref=
erred stackoverflow link.<br><br>You approach is interesting, another one t=
hat&#39;s also backwards compatible<br>is to make _ refer to the last objec=
t, overriding the previous one without<br>destructing it on overriding.<br>=
<br>Em s=C3=A1bado, 9 de julho de 2016 20:30:01 UTC-3, Tony V E  escreveu:<=
blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border=
-left:1px #ccc solid;padding-left:1ex"><div style=3D"background-color:rgb(2=
55,255,255);line-height:initial" lang=3D"en-US">                           =
                                                           <div style=3D"wi=
dth:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-ser=
if,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(=
255,255,255)">I&#39;ve been considering a feature where we could use (and r=
euse) _ as an anonymous variable name.=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)">Foo _ =3D 10; //allowed today<=
/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)">_.member(); // ok</div><div style=3D"wid=
th:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-seri=
f,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(2=
55,255,255)">Bar _ =3D 5; // new - anonymous variable<span style=3D"font-si=
ze:initial;text-align:initial;line-height:initial">=E2=80=8E (both _ in sco=
pe)</span></div><div style=3D"width:100%;font-size:initial;font-family:Cali=
bri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-ali=
gn:initial;background-color:rgb(255,255,255)">_.func(); // compile failure=
=E2=80=8E - ambiguous _</div><div style=3D"width:100%;font-size:initial;fon=
t-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,=
125);text-align:initial;background-color:rgb(255,255,255)"><span style=3D"f=
ont-size:initial;line-height:initial;text-align:initial"><br></span></div><=
div style=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pr=
o&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;backgr=
ound-color:rgb(255,255,255)"><span style=3D"font-size:initial;line-height:i=
nitial;text-align:initial"><br></span></div><div style=3D"width:100%;font-s=
ize:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;c=
olor:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)">B=
asically allow one or more variables named _.=C2=A0</div><div style=3D"widt=
h: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(25=
5,255,255)">If you have just one, then everything works as today (backwards=
 compatible).=C2=A0</div><div style=3D"width:100%;font-size:initial;font-fa=
mily: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;,sa=
ns-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-colo=
r:rgb(255,255,255)">Once you have more than one _ variable, they all become=
 anonymous. </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;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>    =
                                                                           =
                                                                           =
                        <table style=3D"background-color:white;border-spaci=
ng:0px" width=3D"100%"> <tbody><tr><td colspan=3D"2" style=3D"font-size:ini=
tial;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>Francisco Lopes</div><div><b>Sent: </b>Saturday, July 9, 2016 6:26 PM</d=
iv><div><b>To: </b>ISO C++ Standard - Future Proposals</div><div><b>Reply T=
o: </b><a rel=3D"nofollow">std-pr...@isocpp.org</a></div><div><b>Subject: <=
/b>[std-proposals] Re: deferring destruction</div></div></td></tr></tbody><=
/table><div style=3D"border-style:solid none none;border-top-color:rgb(186,=
188,209);border-top-width:1pt;font-size:initial;text-align:initial;backgrou=
nd-color:rgb(255,255,255)"></div><br><div><div dir=3D"ltr">It would also be=
 like having the hability of declaring anonymous variables.<br>It could be =
possible to obtain the same as defer if it was possible to have<br>a specia=
l variable name placeholder that in truth woudn&#39;t name anything, it cou=
ld<br>be auto?!<br><br><span style=3D"font-family:courier new,monospace">#i=
nclude &lt;memory&gt;<br>#include &lt;iostream&gt;<br><br>int main() {<br>=
=C2=A0=C2=A0=C2=A0 std::shared_ptr&lt;void&gt; auto(nullptr, [](...){ std::=
cout &lt;&lt; 4; });<br>=C2=A0=C2=A0=C2=A0 std::cout &lt;&lt; 1;<br><br>=C2=
=A0=C2=A0=C2=A0 std::shared_ptr&lt;void&gt; auto(nullptr, [](...){ std::cou=
t &lt;&lt; 3; });<br>=C2=A0=C2=A0=C2=A0 std::cout &lt;&lt; 2;<br>}</span><b=
r><br>Anyway, I&#39;d not like to disperse, just focus on the functionality=
..<br><br>Em s=C3=A1bado, 9 de julho de 2016 19:10:12 UTC-3, Francisco Lopes=
  escreveu:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:=
0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Ah, I j=
ust realized... new keyword yeah, it&#39;s problematic to add. But I care m=
ore<br>for the feature, not how it enters, so let&#39;s assume that requiri=
ng a new keyword<br>is not a requirement in the proposal.<br><br>Em s=C3=A1=
bado, 9 de julho de 2016 19:01:54 UTC-3, Francisco Lopes  escreveu:<blockqu=
ote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1=
px #ccc solid;padding-left:1ex"><div dir=3D"ltr">It has been some years thi=
s idea floats in my mind as a nice feature, so I&#39;d like<br>to ask you g=
uys whether you also feel it would be helpful as I think so, it&#39;s my fi=
rst proposal sketch here.<br><br>I&#39;d like to suggest a new keyword, <sp=
an style=3D"font-family:courier new,monospace"><b>defer</b></span>, whose m=
ain purpose is to extend<br>the lifetime of a temporary following it, to th=
e enclosing scope.<br><br>Which would help on situations like this<br><br><=
pre><code><span style=3D"font-family:courier new,monospace"><span>#include<=
/span><span> </span><span>&lt;memory&gt;</span><span></span><span><br>#incl=
ude &lt;iostream&gt;<br><br>int main() {<br>    std::shared_ptr&lt;void&gt;=
 at_exit_1(nullptr, [](...){ std::cout &lt;&lt; 4; });<br>    std::cout &lt=
;&lt; 1;<br><br>    std::shared_ptr&lt;void&gt; at_exit_2(nullptr, [](...){=
 std::cout &lt;&lt; 3; });<br>    std::cout &lt;&lt; 2;<br>}</span></span><=
/code><code><span style=3D"font-family:courier new,monospace"><span></span>=
<span></span></span><span><span style=3D"font-family:courier new,monospace"=
></span><br><br>which could be rewritten like:<br></span></code><br><code><=
span><code><span style=3D"font-family:courier new,monospace"><span>#include=
</span><span> </span><span>&lt;memory&gt;</span><span></span><span><br>#inc=
lude &lt;iostream&gt;<br><br>int main() {<br>    defer std::shared_ptr&lt;v=
oid&gt;(nullptr, [](...){ std::cout &lt;&lt; 4; });<br>    std::cout &lt;&l=
t; 1;<br><br>    defer std::shared_ptr&lt;void&gt;(nullptr, [](...){ std::c=
out &lt;&lt; 3; });<br>    std::cout &lt;&lt; 2;<br>}</span></span></code><=
br><br>without having to care for naming without necessity.<br><br>I know s=
uch kind of situation happen not only when using that kind of <span style=
=3D"font-family:courier new,monospace">at_exit</span><br>trick, but also, t=
his is a feature that couples perfectly to <span style=3D"font-family:couri=
er new,monospace">std::lock_guard</span><br>or any kind of guard for that m=
atter.<br><br>This would also have a strong connection with the <span style=
=3D"font-family:courier new,monospace">scope_exit &amp; unique_resource</sp=
an><br>proposal.<br><br>The keyword is inspired in the <span style=3D"font-=
family:courier new,monospace">defer</span> keyword from the Go programming =
language.<br><br>Actually, I just happened to come here after reviewing som=
e questions on StackOverflow<br>where I have had participation:<br><br>- <a=
 href=3D"http://stackoverflow.com/questions/33050620" rel=3D"nofollow" targ=
et=3D"_blank" onmousedown=3D"this.href=3D&#39;http://www.google.com/url?q\x=
3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F33050620\x26sa\x3dD\x26sntz\=
x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01-lJ-uW5BqJ_cA&#39;;return true;" onclic=
k=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackover=
flow.com%2Fquestions%2F33050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFOB=
lSwGNeSefe01-lJ-uW5BqJ_cA&#39;;return true;">http://stackoverflow.com/<wbr>=
questions/33050620</a><br><br>Regards,<br>Francisco Lopes<br></span></code>=
</pre></div></blockquote></div></blockquote></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 rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</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/c7f9426b-47db-4760-848d-19354dd5fa82%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank" onmousedown=3D"this.href=3D&#39;https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/c7f9426b-47db-4760-848d-19354dd5fa82%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" on=
click=3D"this.href=3D&#39;https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/c7f9426b-47db-4760-848d-19354dd5fa82%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/c7f9426b-47db-4760-<wbr>848d-=
19354dd5fa82%40isocpp.org</a><wbr>.<br>
<br></div></div>
</blockquote></div></blockquote></div></blockquote></div></blockquote></div=
></blockquote></div></blockquote></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/bc87f72c-6cd2-4d75-afd8-1af5310b5508%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/bc87f72c-6cd2-4d75-afd8-1af5310b5508=
%40isocpp.org</a>.<br />

------=_Part_2148_840145629.1468111901508--

------=_Part_2147_2024327089.1468111901507--

.


Author: Arthur O'Dwyer <arthur.j.odwyer@gmail.com>
Date: Sat, 9 Jul 2016 23:17:59 -0700 (PDT)
Raw View
------=_Part_3316_131466903.1468131479224
Content-Type: multipart/alternative;
 boundary="----=_Part_3317_1091957218.1468131479224"

------=_Part_3317_1091957218.1468131479224
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Saturday, July 9, 2016 at 3:01:54 PM UTC-7, Francisco Lopes wrote:
>
> It has been some years this idea floats in my mind as a nice feature, so=
=20
> I'd like
> to ask you guys whether you also feel it would be helpful as I think so,=
=20
> it's my first proposal sketch here.
>
> I'd like to suggest a new keyword, *defer*, whose main purpose is to=20
> extend
> the lifetime of a temporary following it, to the enclosing scope.
>
[...]

> The keyword is inspired in the defer keyword from the Go programming lang=
uage.
>
> Actually, I just happened to come here after reviewing some questions on =
StackOverflow
> where I have had participation:
>
> - http://stackoverflow.com/questions/33050620
>
>
I've just posted an answer that I think will satisfy your craving for Go's=
=20
defer statement in C++; please take a look.
http://stackoverflow.com/a/38289141/1424877

In general, the C++ standard will never have anything like defer, because=
=20
C++ has something better and safer: *destructors*. When you have proper=20
RAII, you don't need a mechanism for deferring arbitrary code; the only=20
reason to defer arbitrary code is for hacks (and I say that having written=
=20
a *lot* of such hacks myself). Standardizing such a mechanism would be=20
sending the wrong message; the standard should be encouraging and=20
standardizing things that allow people to write *better and more=20
maintainable* code, not *worse* code.

That said, if you need something like it in your codebase, the complete=20
source code to Auto() is only 16 lines long. I provided it=20
cut-and-pasteable in that StackOverflow answer.

HTH,
=E2=80=93Arthur

--=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/80517659-071a-4e31-b0a1-47c021ffb06c%40isocpp.or=
g.

------=_Part_3317_1091957218.1468131479224
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Saturday, July 9, 2016 at 3:01:54 PM UTC-7, Francisco L=
opes wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left=
: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">It=
 has been some years this idea floats in my mind as a nice feature, so I&#3=
9;d like<br>to ask you guys whether you also feel it would be helpful as I =
think so, it&#39;s my first proposal sketch here.<br><br>I&#39;d like to su=
ggest a new keyword, <span style=3D"font-family:courier new,monospace"><b>d=
efer</b></span>, whose main purpose is to extend<br>the lifetime of a tempo=
rary following it, to the enclosing scope.</div></blockquote><div>[...]</di=
v><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;b=
order-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><pre><code>=
<span>The keyword is inspired in the <span style=3D"font-family:courier new=
,monospace">defer</span> keyword from the Go programming language.<br><br>A=
ctually, I just happened to come here after reviewing some questions on Sta=
ckOverflow<br>where I have had participation:<br><br>- <a href=3D"http://st=
ackoverflow.com/questions/33050620" target=3D"_blank" rel=3D"nofollow" onmo=
usedown=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fsta=
ckoverflow.com%2Fquestions%2F33050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQ=
jCNFOBlSwGNeSefe01-lJ-uW5BqJ_cA&#39;;return true;" onclick=3D"this.href=3D&=
#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestio=
ns%2F33050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01-lJ-uW=
5BqJ_cA&#39;;return true;">http://stackoverflow.com/<wbr>questions/33050620=
</a></span></code></pre></div></blockquote><div><br></div><div>I&#39;ve jus=
t posted an answer that I think will satisfy your craving for Go&#39;s <fon=
t face=3D"courier new, monospace">defer</font> statement in C++; please tak=
e a look.</div><div><a href=3D"http://stackoverflow.com/a/38289141/1424877"=
>http://stackoverflow.com/a/38289141/1424877</a><br></div><div><br></div><d=
iv>In general, the C++ standard will never have anything like <font face=3D=
"courier new, monospace">defer</font>, because C++ has something better and=
 safer: <i>destructors</i>. When you have proper RAII, you don&#39;t need a=
 mechanism for deferring arbitrary code; the only reason to defer arbitrary=
 code is for hacks (and I say that having written a <i><b>lot</b></i> of su=
ch hacks myself). Standardizing such a mechanism would be sending the wrong=
 message; the standard should be encouraging and standardizing things that =
allow people to write <i>better and more maintainable</i> code, not <i>wors=
e</i> code.</div><div><br></div><div>That said, if you need something like =
it in your codebase, the complete source code to Auto() is only 16 lines lo=
ng. I provided it cut-and-pasteable in that StackOverflow answer.</div><div=
><br></div><div>HTH,</div><div>=E2=80=93Arthur</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/80517659-071a-4e31-b0a1-47c021ffb06c%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/80517659-071a-4e31-b0a1-47c021ffb06c=
%40isocpp.org</a>.<br />

------=_Part_3317_1091957218.1468131479224--

------=_Part_3316_131466903.1468131479224--

.


Author: Francisco Lopes <francisco.mailing.lists@oblita.com>
Date: Sun, 10 Jul 2016 05:33:04 -0700 (PDT)
Raw View
------=_Part_115_75704066.1468153984942
Content-Type: multipart/alternative;
 boundary="----=_Part_116_819239006.1468153984943"

------=_Part_116_819239006.1468153984943
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Thanks for your answer Arthur.

I advice you to take a look in my previous message in the topic, anonymous
variables woudn't benefit only that usecase.

Personally, I'm not interested in carrying such kind of code around anywher=
e
I work, just like I don't like to have to carry any bit that has been=20
standardized,
that's what the standardization process exists for. Standardize useful=20
tools that
otherwise are present in many codebases implemented by diverse manners.
I've seen scope_exit etc present in many well known code bases.

scope_exit and unique_resource thread has many argument battles regarding=
=20
that,
I myself was present in there. My point of view about this is that there's
no point going forward on this. There are non-definite arguments from
both sides, and the choice boils down to taste, if we go forward it will
be just a religious battle.

I take your point but I really don't wish to go back to the scope_exit and
unique_resource discussion. As said before, anonymous variables could
help not only this but also ergonomics for:

- multiple return and destructuring.
- any kind of scope guards.
- scope_exit usage.

And I think the usecases will keep growing.

Em domingo, 10 de julho de 2016 03:17:59 UTC-3, Arthur O'Dwyer escreveu:
>
> On Saturday, July 9, 2016 at 3:01:54 PM UTC-7, Francisco Lopes wrote:
>>
>> It has been some years this idea floats in my mind as a nice feature, so=
=20
>> I'd like
>> to ask you guys whether you also feel it would be helpful as I think so,=
=20
>> it's my first proposal sketch here.
>>
>> I'd like to suggest a new keyword, *defer*, whose main purpose is to=20
>> extend
>> the lifetime of a temporary following it, to the enclosing scope.
>>
> [...]
>
>> The keyword is inspired in the defer keyword from the Go programming lan=
guage.
>>
>> Actually, I just happened to come here after reviewing some questions on=
 StackOverflow
>> where I have had participation:
>>
>> - http://stackoverflow.com/questions/33050620
>>
>>
> I've just posted an answer that I think will satisfy your craving for Go'=
s=20
> defer statement in C++; please take a look.
> http://stackoverflow.com/a/38289141/1424877
>
> In general, the C++ standard will never have anything like defer, because=
=20
> C++ has something better and safer: *destructors*. When you have proper=
=20
> RAII, you don't need a mechanism for deferring arbitrary code; the only=
=20
> reason to defer arbitrary code is for hacks (and I say that having writte=
n=20
> a *lot* of such hacks myself). Standardizing such a mechanism would be=20
> sending the wrong message; the standard should be encouraging and=20
> standardizing things that allow people to write *better and more=20
> maintainable* code, not *worse* code.
>
> That said, if you need something like it in your codebase, the complete=
=20
> source code to Auto() is only 16 lines long. I provided it=20
> cut-and-pasteable in that StackOverflow answer.
>
> HTH,
> =E2=80=93Arthur
>

--=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/656decf9-2a55-43d7-9f99-c603e9799e34%40isocpp.or=
g.

------=_Part_116_819239006.1468153984943
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thanks for your answer Arthur.<br><br>I advice you to take=
 a look in my previous message in the topic, anonymous<br>variables woudn&#=
39;t benefit only that usecase.<br><br>Personally, I&#39;m not interested i=
n carrying such kind of code around anywhere<br>I work, just like I don&#39=
;t like to have to carry any bit that has been standardized,<br>that&#39;s =
what the standardization process exists for. Standardize useful tools that<=
br>otherwise are present in many codebases implemented by diverse manners.<=
br>I&#39;ve seen scope_exit etc present in many well known code bases.<br><=
br>scope_exit and unique_resource thread has many argument battles regardin=
g that,<br>I myself was present in there. My point of view about this is th=
at there&#39;s<br>no point going forward on this. There are non-definite ar=
guments from<br>both sides, and the choice boils down to taste, if we go fo=
rward it will<br>be just a religious battle.<br><br>I take your point but I=
 really don&#39;t wish to go back to the scope_exit and<br>unique_resource =
discussion. As said before, anonymous variables could<br>help not only this=
 but also ergonomics for:<br><br>- multiple return and destructuring.<br>- =
any kind of scope guards.<br>- scope_exit usage.<br><br>And I think the use=
cases will keep growing.<br><br>Em domingo, 10 de julho de 2016 03:17:59 UT=
C-3, Arthur O&#39;Dwyer  escreveu:<blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;"><div dir=3D"ltr">On Saturday, July 9, 2016 at 3:01:54 PM UTC-7, Franc=
isco Lopes wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin=
-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">I=
t has been some years this idea floats in my mind as a nice feature, so I&#=
39;d like<br>to ask you guys whether you also feel it would be helpful as I=
 think so, it&#39;s my first proposal sketch here.<br><br>I&#39;d like to s=
uggest a new keyword, <span style=3D"font-family:courier new,monospace"><b>=
defer</b></span>, whose main purpose is to extend<br>the lifetime of a temp=
orary following it, to the enclosing scope.</div></blockquote><div>[...]</d=
iv><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><pre><code><spa=
n>The keyword is inspired in the <span style=3D"font-family:courier new,mon=
ospace">defer</span> keyword from the Go programming language.<br><br>Actua=
lly, I just happened to come here after reviewing some questions on StackOv=
erflow<br>where I have had participation:<br><br>- <a href=3D"http://stacko=
verflow.com/questions/33050620" rel=3D"nofollow" target=3D"_blank" onmoused=
own=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackov=
erflow.com%2Fquestions%2F33050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF=
OBlSwGNeSefe01-lJ-uW5BqJ_cA&#39;;return true;" onclick=3D"this.href=3D&#39;=
http://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2=
F33050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01-lJ-uW5BqJ=
_cA&#39;;return true;">http://stackoverflow.com/<wbr>questions/33050620</a>=
</span></code></pre></div></blockquote><div><br></div><div>I&#39;ve just po=
sted an answer that I think will satisfy your craving for Go&#39;s <font fa=
ce=3D"courier new, monospace">defer</font> statement in C++; please take a =
look.</div><div><a href=3D"http://stackoverflow.com/a/38289141/1424877" tar=
get=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http://www.=
google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fa%2F38289141%2F1424877=
\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH-iMH67wVRSiH0xkJpC1_ArxhpyA&#39;;=
return true;" onclick=3D"this.href=3D&#39;http://www.google.com/url?q\x3dht=
tp%3A%2F%2Fstackoverflow.com%2Fa%2F38289141%2F1424877\x26sa\x3dD\x26sntz\x3=
d1\x26usg\x3dAFQjCNH-iMH67wVRSiH0xkJpC1_ArxhpyA&#39;;return true;">http://s=
tackoverflow.com/a/<wbr>38289141/1424877</a><br></div><div><br></div><div>I=
n general, the C++ standard will never have anything like <font face=3D"cou=
rier new, monospace">defer</font>, because C++ has something better and saf=
er: <i>destructors</i>. When you have proper RAII, you don&#39;t need a mec=
hanism for deferring arbitrary code; the only reason to defer arbitrary cod=
e is for hacks (and I say that having written a <i><b>lot</b></i> of such h=
acks myself). Standardizing such a mechanism would be sending the wrong mes=
sage; the standard should be encouraging and standardizing things that allo=
w people to write <i>better and more maintainable</i> code, not <i>worse</i=
> code.</div><div><br></div><div>That said, if you need something like it i=
n your codebase, the complete source code to Auto() is only 16 lines long. =
I provided it cut-and-pasteable in that StackOverflow answer.</div><div><br=
></div><div>HTH,</div><div>=E2=80=93Arthur</div></div></blockquote></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/656decf9-2a55-43d7-9f99-c603e9799e34%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/656decf9-2a55-43d7-9f99-c603e9799e34=
%40isocpp.org</a>.<br />

------=_Part_116_819239006.1468153984943--

------=_Part_115_75704066.1468153984942--

.


Author: Francisco Lopes <francisco.mailing.lists@oblita.com>
Date: Sun, 10 Jul 2016 10:38:44 -0700 (PDT)
Raw View
------=_Part_3963_547901829.1468172324388
Content-Type: multipart/alternative;
 boundary="----=_Part_3964_2099767257.1468172324388"

------=_Part_3964_2099767257.1468172324388
Content-Type: text/plain; charset=UTF-8

I've opted to move the topic for better focus to:

-
https://groups.google.com/a/isocpp.org/d/msg/std-proposals/OKUpODP9-7w/oQq-asoYCgAJ

Consider this one closed, thanks.

--
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/9baf250c-67e4-4f97-9dc6-7734d47613ad%40isocpp.org.

------=_Part_3964_2099767257.1468172324388
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I&#39;ve opted to move the topic for better focus to:<br><=
br>-<a href=3D"https://groups.google.com/a/isocpp.org/d/msg/std-proposals/O=
KUpODP9-7w/oQq-asoYCgAJ"> https://groups.google.com/a/isocpp.org/d/msg/std-=
proposals/OKUpODP9-7w/oQq-asoYCgAJ</a><br><br>Consider this one closed, tha=
nks.<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/9baf250c-67e4-4f97-9dc6-7734d47613ad%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/9baf250c-67e4-4f97-9dc6-7734d47613ad=
%40isocpp.org</a>.<br />

------=_Part_3964_2099767257.1468172324388--

------=_Part_3963_547901829.1468172324388--

.


Author: FrankHB1989 <frankhb1989@gmail.com>
Date: Mon, 11 Jul 2016 02:09:34 -0700 (PDT)
Raw View
------=_Part_179_1867539835.1468228174891
Content-Type: multipart/alternative;
 boundary="----=_Part_180_981702123.1468228174892"

------=_Part_180_981702123.1468228174892
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

I don't think the phrase "anonymous variable" well-formed technically.=20
Traditionally, a variable always has at least one name in some scope. It=20
has not been changed in C++, and I don't think it needed to be changed.=20
Perhaps "unnamed variable" would be better.
BTW, union can be anonymous; namespaces are not allowed to be specified=20
anonymous by users; the global namespace is "anonymous".

=E5=9C=A8 2016=E5=B9=B47=E6=9C=8810=E6=97=A5=E6=98=9F=E6=9C=9F=E6=97=A5 UTC=
+8=E4=B8=8A=E5=8D=888:35:09=EF=BC=8CFrancisco Lopes=E5=86=99=E9=81=93=EF=BC=
=9A
>
> We may accept the subject changed to "Anonymous Variables" by now.
>
> Em s=C3=A1bado, 9 de julho de 2016 21:25:55 UTC-3, Francisco Lopes escrev=
eu:
>>
>> Meaning, if we ever get destructuring with a placeholder (afaik it has=
=20
>> been explicitly excluded from
>> current proposal) wouldn't it actually touch this same subject?
>>
>> Em s=C3=A1bado, 9 de julho de 2016 21:22:32 UTC-3, Francisco Lopes escre=
veu:
>>>
>>> heh, ok. Using _ made me also connect it with the=20
>>> destructuring/multiple-return proposal.
>>>
>>> Em s=C3=A1bado, 9 de julho de 2016 21:10:23 UTC-3, Francisco Lopes escr=
eveu:
>>>>
>>>> I've considered (but not commented) about using _ too. It's what I=20
>>>> employ
>>>> in the referred stackoverflow link.
>>>>
>>>> You approach is interesting, another one that's also backwards=20
>>>> compatible
>>>> is to make _ refer to the last object, overriding the previous one=20
>>>> without
>>>> destructing it on overriding.
>>>>
>>>> Em s=C3=A1bado, 9 de julho de 2016 20:30:01 UTC-3, Tony V E escreveu:
>>>>>
>>>>> I've been considering a feature where we could use (and reuse) _ as a=
n=20
>>>>> anonymous variable name.=20
>>>>>
>>>>> Foo _ =3D 10; //allowed today
>>>>> _.member(); // ok
>>>>> Bar _ =3D 5; // new - anonymous variable=E2=80=8E (both _ in scope)
>>>>> _.func(); // compile failure=E2=80=8E - ambiguous _
>>>>>
>>>>>
>>>>> Basically allow one or more variables named _.=20
>>>>> If you have just one, then everything works as today (backwards=20
>>>>> compatible).=20
>>>>>
>>>>> Once you have more than one _ variable, they all become anonymous.=20
>>>>>
>>>>> Sent from my BlackBerry portable Babbage Device
>>>>> *From: *Francisco Lopes
>>>>> *Sent: *Saturday, July 9, 2016 6:26 PM
>>>>> *To: *ISO C++ Standard - Future Proposals
>>>>> *Reply To: *std-pr...@isocpp.org
>>>>> *Subject: *[std-proposals] Re: deferring destruction
>>>>>
>>>>> It would also be like having the hability of declaring anonymous=20
>>>>> variables.
>>>>> It could be possible to obtain the same as defer if it was possible t=
o=20
>>>>> have
>>>>> a special variable name placeholder that in truth woudn't name=20
>>>>> anything, it could
>>>>> be auto?!
>>>>>
>>>>> #include <memory>
>>>>> #include <iostream>
>>>>>
>>>>> int main() {
>>>>>     std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 4; });
>>>>>     std::cout << 1;
>>>>>
>>>>>     std::shared_ptr<void> auto(nullptr, [](...){ std::cout << 3; });
>>>>>     std::cout << 2;
>>>>> }
>>>>>
>>>>> Anyway, I'd not like to disperse, just focus on the functionality.
>>>>>
>>>>> Em s=C3=A1bado, 9 de julho de 2016 19:10:12 UTC-3, Francisco Lopes es=
creveu:
>>>>>>
>>>>>> Ah, I just realized... new keyword yeah, it's problematic to add. Bu=
t=20
>>>>>> I care more
>>>>>> for the feature, not how it enters, so let's assume that requiring a=
=20
>>>>>> new keyword
>>>>>> is not a requirement in the proposal.
>>>>>>
>>>>>> Em s=C3=A1bado, 9 de julho de 2016 19:01:54 UTC-3, Francisco Lopes=
=20
>>>>>> escreveu:
>>>>>>>
>>>>>>> It has been some years this idea floats in my mind as a nice=20
>>>>>>> feature, so I'd like
>>>>>>> to ask you guys whether you also feel it would be helpful as I thin=
k=20
>>>>>>> so, it's my first proposal sketch here.
>>>>>>>
>>>>>>> I'd like to suggest a new keyword, *defer*, whose main purpose is=
=20
>>>>>>> to extend
>>>>>>> the lifetime of a temporary following it, to the enclosing scope.
>>>>>>>
>>>>>>> Which would help on situations like this
>>>>>>>
>>>>>>> #include <memory>
>>>>>>> #include <iostream>
>>>>>>>
>>>>>>> int main() {
>>>>>>>     std::shared_ptr<void> at_exit_1(nullptr, [](...){ std::cout << =
4; });
>>>>>>>     std::cout << 1;
>>>>>>>
>>>>>>>     std::shared_ptr<void> at_exit_2(nullptr, [](...){ std::cout << =
3; });
>>>>>>>     std::cout << 2;
>>>>>>> }
>>>>>>>
>>>>>>> which could be rewritten like:
>>>>>>>
>>>>>>> #include <memory>
>>>>>>> #include <iostream>
>>>>>>>
>>>>>>> int main() {
>>>>>>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 4; }=
);
>>>>>>>     std::cout << 1;
>>>>>>>
>>>>>>>     defer std::shared_ptr<void>(nullptr, [](...){ std::cout << 3; }=
);
>>>>>>>     std::cout << 2;
>>>>>>> }
>>>>>>>
>>>>>>> without having to care for naming without necessity.
>>>>>>>
>>>>>>> I know such kind of situation happen not only when using that kind =
of at_exit
>>>>>>> trick, but also, this is a feature that couples perfectly to std::l=
ock_guard
>>>>>>> or any kind of guard for that matter.
>>>>>>>
>>>>>>> This would also have a strong connection with the scope_exit & uniq=
ue_resource
>>>>>>> proposal.
>>>>>>>
>>>>>>> The keyword is inspired in the defer keyword from the Go programmin=
g language.
>>>>>>>
>>>>>>> Actually, I just happened to come here after reviewing some questio=
ns on StackOverflow
>>>>>>> where I have had participation:
>>>>>>>
>>>>>>> - http://stackoverflow.com/questions/33050620
>>>>>>>
>>>>>>> Regards,
>>>>>>> Francisco Lopes
>>>>>>>
>>>>>>> --=20
>>>>> You received this message because you are subscribed to the Google=20
>>>>> Groups "ISO C++ Standard - Future Proposals" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, sen=
d=20
>>>>> an email to std-proposal...@isocpp.org.
>>>>> To post to this group, send email to std-pr...@isocpp.org.
>>>>> To view this discussion on the web visit=20
>>>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c7f9426b=
-47db-4760-848d-19354dd5fa82%40isocpp.org=20
>>>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/c7f9426=
b-47db-4760-848d-19354dd5fa82%40isocpp.org?utm_medium=3Demail&utm_source=3D=
footer>
>>>>> .
>>>>>
>>>>>

--=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/29014720-c321-4d00-859d-b246c1aaaf64%40isocpp.or=
g.

------=_Part_180_981702123.1468228174892
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I don&#39;t think the phrase &quot;anonymous variable&quot=
; well-formed technically. Traditionally, a variable always has at least on=
e name in some scope. It has not been changed in C++, and I don&#39;t think=
 it needed to be changed. Perhaps &quot;unnamed variable&quot; would be bet=
ter.<br>BTW, union can be anonymous; namespaces are not allowed to be speci=
fied anonymous by users; the global namespace is &quot;anonymous&quot;.<br>=
<br>=E5=9C=A8 2016=E5=B9=B47=E6=9C=8810=E6=97=A5=E6=98=9F=E6=9C=9F=E6=97=A5=
 UTC+8=E4=B8=8A=E5=8D=888:35:09=EF=BC=8CFrancisco Lopes=E5=86=99=E9=81=93=
=EF=BC=9A<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: =
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">We m=
ay accept the subject changed to &quot;Anonymous Variables&quot; by now.<br=
><br>Em s=C3=A1bado, 9 de julho de 2016 21:25:55 UTC-3, Francisco Lopes  es=
creveu:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8e=
x;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Meaning, if=
 we ever get destructuring with a placeholder (afaik it has been explicitly=
 excluded from<br>current proposal) wouldn&#39;t it actually touch this sam=
e subject?<br><br>Em s=C3=A1bado, 9 de julho de 2016 21:22:32 UTC-3, Franci=
sco Lopes  escreveu:<blockquote class=3D"gmail_quote" style=3D"margin:0;mar=
gin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr=
">heh, ok. Using _ made me also connect it with the destructuring/multiple-=
return proposal.<br><br>Em s=C3=A1bado, 9 de julho de 2016 21:10:23 UTC-3, =
Francisco Lopes  escreveu:<blockquote class=3D"gmail_quote" style=3D"margin=
:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr">I&#39;ve considered (but not commented) about using _ too. It&#39;=
s what I employ<br>in the referred stackoverflow link.<br><br>You approach =
is interesting, another one that&#39;s also backwards compatible<br>is to m=
ake _ refer to the last object, overriding the previous one without<br>dest=
ructing it on overriding.<br><br>Em s=C3=A1bado, 9 de julho de 2016 20:30:0=
1 UTC-3, Tony V E  escreveu:<blockquote class=3D"gmail_quote" style=3D"marg=
in:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div st=
yle=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,125);text-align:=
initial;background-color:rgb(255,255,255)">I&#39;ve been considering a feat=
ure where we could use (and reuse) _ as an anonymous variable name.=C2=A0</=
div><div style=3D"width:100%;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)"><br></div><div style=3D"width:100%;font-s=
ize:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;c=
olor:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)">F=
oo _ =3D 10; //allowed today</div><div style=3D"width:100%;font-size:initia=
l;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(3=
1,73,125);text-align:initial;background-color:rgb(255,255,255)">_.member();=
 // ok</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:i=
nitial;background-color:rgb(255,255,255)">Bar _ =3D 5; // new - anonymous v=
ariable<span style=3D"font-size:initial;text-align:initial;line-height:init=
ial">=E2=80=8E (both _ in scope)</span></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)">=
_.func(); // compile failure=E2=80=8E - ambiguous _</div><div style=3D"widt=
h: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(25=
5,255,255)"><span style=3D"font-size:initial;line-height:initial;text-align=
:initial"><br></span></div><div style=3D"width:100%;font-size:initial;font-=
family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,12=
5);text-align:initial;background-color:rgb(255,255,255)"><span style=3D"fon=
t-size:initial;line-height:initial;text-align:initial"><br></span></div><di=
v 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;backgrou=
nd-color:rgb(255,255,255)">Basically allow one or more variables named _.=
=C2=A0</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:i=
nitial;background-color:rgb(255,255,255)">If you have just one, then everyt=
hing works as today (backwards compatible).=C2=A0</div><div style=3D"width:=
100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,s=
ans-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:initial;background-color:rgb(255,255,255)">Once you have more than o=
ne _ variable, they all become anonymous. </div>                           =
                                                                           =
                               <div style=3D"width:100%;font-size:initial;f=
ont-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,7=
3,125);text-align:initial;background-color:rgb(255,255,255)"><br style=3D"d=
isplay:initial"></div>                                                     =
                                                                           =
                                                                   <div sty=
le=3D"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)">Sent=C2=A0from=C2=A0my=C2=A0BlackBerry=C2=A0<wbr>portable=C2=A0B=
abbage=C2=A0Device</div>                                                   =
                                                                           =
                                                    <table style=3D"backgro=
und-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(2=
55,255,255)">                           <div style=3D"border-style:solid no=
ne 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>Francisco Lopes</div><div><b>Sent: </b>Satu=
rday, July 9, 2016 6:26 PM</div><div><b>To: </b>ISO C++ Standard - Future P=
roposals</div><div><b>Reply To: </b><a rel=3D"nofollow">std-pr...@isocpp.or=
g</a></div><div><b>Subject: </b>[std-proposals] Re: deferring destruction</=
div></div></td></tr></tbody></table><div style=3D"border-style:solid none n=
one;border-top-color:rgb(186,188,209);border-top-width:1pt;font-size:initia=
l;text-align:initial;background-color:rgb(255,255,255)"></div><br><div><div=
 dir=3D"ltr">It would also be like having the hability of declaring anonymo=
us variables.<br>It could be possible to obtain the same as defer if it was=
 possible to have<br>a special variable name placeholder that in truth woud=
n&#39;t name anything, it could<br>be auto?!<br><br><span style=3D"font-fam=
ily:courier new,monospace">#include &lt;memory&gt;<br>#include &lt;iostream=
&gt;<br><br>int main() {<br>=C2=A0=C2=A0=C2=A0 std::shared_ptr&lt;void&gt; =
auto(nullptr, [](...){ std::cout &lt;&lt; 4; });<br>=C2=A0=C2=A0=C2=A0 std:=
:cout &lt;&lt; 1;<br><br>=C2=A0=C2=A0=C2=A0 std::shared_ptr&lt;void&gt; aut=
o(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>=C2=A0=C2=A0=C2=A0 std::co=
ut &lt;&lt; 2;<br>}</span><br><br>Anyway, I&#39;d not like to disperse, jus=
t focus on the functionality.<br><br>Em s=C3=A1bado, 9 de julho de 2016 19:=
10:12 UTC-3, Francisco Lopes  escreveu:<blockquote class=3D"gmail_quote" st=
yle=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1=
ex"><div dir=3D"ltr">Ah, I just realized... new keyword yeah, it&#39;s prob=
lematic to add. But I care more<br>for the feature, not how it enters, so l=
et&#39;s assume that requiring a new keyword<br>is not a requirement in the=
 proposal.<br><br>Em s=C3=A1bado, 9 de julho de 2016 19:01:54 UTC-3, Franci=
sco Lopes  escreveu:<blockquote class=3D"gmail_quote" style=3D"margin:0;mar=
gin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr=
">It has been some years this idea floats in my mind as a nice feature, so =
I&#39;d like<br>to ask you guys whether you also feel it would be helpful a=
s I think so, it&#39;s my first proposal sketch here.<br><br>I&#39;d like t=
o suggest a new keyword, <span style=3D"font-family:courier new,monospace">=
<b>defer</b></span>, whose main purpose is to extend<br>the lifetime of a t=
emporary following it, to the enclosing scope.<br><br>Which would help on s=
ituations like this<br><br><pre><code><span style=3D"font-family:courier ne=
w,monospace"><span>#include</span><span> </span><span>&lt;memory&gt;</span>=
<span></span><span><br>#include &lt;iostream&gt;<br><br>int main() {<br>   =
 std::shared_ptr&lt;void&gt; at_exit_1(nullptr, [](...){ std::cout &lt;&lt;=
 4; });<br>    std::cout &lt;&lt; 1;<br><br>    std::shared_ptr&lt;void&gt;=
 at_exit_2(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>    std::cout &lt=
;&lt; 2;<br>}</span></span></code><code><span style=3D"font-family:courier =
new,monospace"><span></span><span></span></span><span><span style=3D"font-f=
amily:courier new,monospace"></span><br><br>which could be rewritten like:<=
br></span></code><br><code><span><code><span style=3D"font-family:courier n=
ew,monospace"><span>#include</span><span> </span><span>&lt;memory&gt;</span=
><span></span><span><br>#include &lt;iostream&gt;<br><br>int main() {<br>  =
  defer std::shared_ptr&lt;void&gt;(nullptr, [](...){ std::cout &lt;&lt; 4;=
 });<br>    std::cout &lt;&lt; 1;<br><br>    defer std::shared_ptr&lt;void&=
gt;(nullptr, [](...){ std::cout &lt;&lt; 3; });<br>    std::cout &lt;&lt; 2=
;<br>}</span></span></code><br><br>without having to care for naming withou=
t necessity.<br><br>I know such kind of situation happen not only when usin=
g that kind of <span style=3D"font-family:courier new,monospace">at_exit</s=
pan><br>trick, but also, this is a feature that couples perfectly to <span =
style=3D"font-family:courier new,monospace">std::lock_guard</span><br>or an=
y kind of guard for that matter.<br><br>This would also have a strong conne=
ction with the <span style=3D"font-family:courier new,monospace">scope_exit=
 &amp; unique_resource</span><br>proposal.<br><br>The keyword is inspired i=
n the <span style=3D"font-family:courier new,monospace">defer</span> keywor=
d from the Go programming language.<br><br>Actually, I just happened to com=
e here after reviewing some questions on StackOverflow<br>where I have had =
participation:<br><br>- <a href=3D"http://stackoverflow.com/questions/33050=
620" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=3D&#39;htt=
p://www.google.com/url?q\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F33=
050620\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01-lJ-uW5BqJ_cA=
&#39;;return true;" onclick=3D"this.href=3D&#39;http://www.google.com/url?q=
\x3dhttp%3A%2F%2Fstackoverflow.com%2Fquestions%2F33050620\x26sa\x3dD\x26snt=
z\x3d1\x26usg\x3dAFQjCNFOBlSwGNeSefe01-lJ-uW5BqJ_cA&#39;;return true;">http=
://stackoverflow.com/<wbr>questions/33050620</a><br><br>Regards,<br>Francis=
co Lopes<br></span></code></pre></div></blockquote></div></blockquote></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 rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</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/c7f9426b-47db-4760-848d-19354dd5fa82%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank" onmousedown=3D"this.href=3D&#39;https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/c7f9426b-47db-4760-848d-19354dd5fa82%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" on=
click=3D"this.href=3D&#39;https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/c7f9426b-47db-4760-848d-19354dd5fa82%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/c7f9426b-47db-4760-<wbr>848d-=
19354dd5fa82%40isocpp.org</a><wbr>.<br>
<br></div></div>
</blockquote></div></blockquote></div></blockquote></div></blockquote></div=
></blockquote></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/29014720-c321-4d00-859d-b246c1aaaf64%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/29014720-c321-4d00-859d-b246c1aaaf64=
%40isocpp.org</a>.<br />

------=_Part_180_981702123.1468228174892--

------=_Part_179_1867539835.1468228174891--

.