Topic: compact 'auto' declaration
Author: michaelparis314@gmail.com
Date: Mon, 3 Nov 2014 02:44:13 -0800 (PST)
Raw View
------=_Part_190_1829468960.1415011453347
Content-Type: text/plain; charset=UTF-8
Hello,
Instead of writing a long list of variables with 'auto':
/* Here we create variables for bla bla */
auto X1 = new X();
auto X2 = new X("bla bla");
.....
The following new syntax could be create a more compact code:
auto {
X1 = new X();
X2 = new X("bla bla");
...
Xn = ..
}
Thanks for reading
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_190_1829468960.1415011453347
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hello,<div><br></div><div>Instead of writing a long list o=
f variables with 'auto':</div><div><br></div><div>/* Here we create variabl=
es for bla bla */</div><div>auto X1 =3D new X();</div><div>auto X2 =3D new =
X("bla bla");</div><div>....</div><div><br></div><div>The following new syn=
tax could be create a more compact code:</div><div><br></div><div><span sty=
le=3D"font-size: 13px;">auto {</span><br></div><div style=3D"font-size: 12.=
8000001907349px;"> X1 =3D new X();</div><div style=3D"font-size=
: 12.8000001907349px;"><span style=3D"font-size: 12.8000001907349px;"> =
; X2 =3D new X("bla bla");</span></div><div><span style=3D"font-size:=
13px;"> ...</span><br></div><div><span style=3D"font-size: 13px;">&n=
bsp; Xn =3D ..</span></div><div>}</div><div><br></div><div>Thanks for=
reading</div><div><br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_190_1829468960.1415011453347--
.
Author: =?UTF-8?Q?Germ=C3=A1n_Diago?= <germandiago@gmail.com>
Date: Mon, 3 Nov 2014 03:57:44 -0800 (PST)
Raw View
------=_Part_416_1759190419.1415015864897
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
El lunes, 3 de noviembre de 2014 17:44:13 UTC+7, michael...@gmail.com=20
escribi=C3=B3:
>
> Hello,
>
> Instead of writing a long list of variables with 'auto':
>
> /* Here we create variables for bla bla */
> auto X1 =3D new X();
> auto X2 =3D new X("bla bla");
> ....
>
> The following new syntax could be create a more compact code:
>
> auto {
> X1 =3D new X();
> X2 =3D new X("bla bla");
> ...
> Xn =3D ..
> }
>
The problem with this is that it looks misleading, since { usually=20
introduces a scope, but this would be an exception to that rule.
Regards=20
> Thanks for reading
>
>
--=20
---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_416_1759190419.1415015864897
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>El lunes, 3 de noviembre de 2014 17:44:13 UTC+7, m=
ichael...@gmail.com escribi=C3=B3:<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">Hello,<div><br></div><div>Instead of writing a long =
list of variables with 'auto':</div><div><br></div><div>/* Here we create v=
ariables for bla bla */</div><div>auto X1 =3D new X();</div><div>auto X2 =
=3D new X("bla bla");</div><div>....</div><div><br></div><div>The following=
new syntax could be create a more compact code:</div><div><br></div><div><=
span style=3D"font-size:13px">auto {</span><br></div><div style=3D"font-siz=
e:12.8000001907349px"> X1 =3D new X();</div><div style=3D"font-=
size:12.8000001907349px"><span style=3D"font-size:12.8000001907349px"> =
; X2 =3D new X("bla bla");</span></div><div><span style=3D"font-size:=
13px"> ...</span><br></div><div><span style=3D"font-size:13px"> =
Xn =3D ..</span></div><div>}</div></div></blockquote><div><br></div>=
<div>The problem with this is that it looks misleading, since { usually int=
roduces a scope, but this would be an exception to that rule.</div><div><br=
></div><div>Regards </div><blockquote class=3D"gmail_quote" style=3D"m=
argin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"=
><div dir=3D"ltr"><div>Thanks for reading</div><div><br></div></div></block=
quote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_416_1759190419.1415015864897--
.
Author: michael paris <michaelparis314@gmail.com>
Date: Mon, 3 Nov 2014 13:19:35 +0100
Raw View
--047d7b4145fc1c96180506f35c77
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
yep, an exception!
main() {
auto {
a =3D 2 + 3;
x =3D new X();
{
int b =3D a + 5;
}
//here b is out of scope!
//But if i declare b using 'auto' in this way:
auto {
b =3D a + 5;
}
new_var =3D b + a; //b is visible
{
auto example =3D 2;
}
//here example is out of scope!
}
}
2014-11-03 12:57 GMT+01:00 Germ=C3=A1n Diago <germandiago@gmail.com>:
>
>
> El lunes, 3 de noviembre de 2014 17:44:13 UTC+7, michael...@gmail.com
> escribi=C3=B3:
>>
>> Hello,
>>
>> Instead of writing a long list of variables with 'auto':
>>
>> /* Here we create variables for bla bla */
>> auto X1 =3D new X();
>> auto X2 =3D new X("bla bla");
>> ....
>>
>> The following new syntax could be create a more compact code:
>>
>> auto {
>> X1 =3D new X();
>> X2 =3D new X("bla bla");
>> ...
>> Xn =3D ..
>> }
>>
>
> The problem with this is that it looks misleading, since { usually
> introduces a scope, but this would be an exception to that rule.
>
> Regards
>
>> Thanks for reading
>>
>>
--=20
---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
--047d7b4145fc1c96180506f35c77
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><span style=3D"font-family:arial,sans-serif;font-size:12.6=
666669845581px">yep, an exception!</span><br><div><br></div><div><div>main(=
) {</div><div>auto {</div><div><span class=3D"" style=3D"white-space:pre"> =
</span>a =3D 2 + 3;</div><div><span class=3D"" style=3D"white-space:pre"> <=
/span>x =3D new X();</div><div><br></div><div><span class=3D"" style=3D"whi=
te-space:pre"> </span>{</div><div><span class=3D"" style=3D"white-space:pre=
"> </span> =C2=A0int b =3D a + 5;</div><div><span class=3D"" style=3D"white=
-space:pre"> </span>}</div><div><br></div><div><span class=3D"" style=3D"wh=
ite-space:pre"> </span>//here b is out of scope!</div><div><br></div><div><=
span class=3D"" style=3D"white-space:pre"> </span>//But if i declare b usin=
g 'auto' in this way:</div><div><span class=3D"" style=3D"white-spa=
ce:pre"> </span>auto {</div><div><span class=3D"" style=3D"white-space:pre"=
> </span>b =3D a + 5;</div><div><span class=3D"" style=3D"white-space:pre"=
> </span>}</div><div><br></div><div><span class=3D"" style=3D"white-space:p=
re"> </span>new_var =3D b + a; //b is visible</div><div><br></div><div><spa=
n class=3D"" style=3D"white-space:pre"> </span>{</div><div>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 auto example =3D 2;</div><div><span class=3D"" =
style=3D"white-space:pre"> </span>}</div><div><br></div><div><span class=3D=
"" style=3D"white-space:pre"> </span>//here example is out of scope!</div><=
div>}</div><div>}</div></div></div><div class=3D"gmail_extra"><br><div clas=
s=3D"gmail_quote">2014-11-03 12:57 GMT+01:00 Germ=C3=A1n Diago <span dir=3D=
"ltr"><<a href=3D"mailto:germandiago@gmail.com" target=3D"_blank">german=
diago@gmail.com</a>></span>:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr"><br><br>El lunes, 3 de noviembre de 2014 17:44:13 UTC+7, <a href=
=3D"mailto:michael...@gmail.com" target=3D"_blank">michael...@gmail.com</a>=
escribi=C3=B3:<span class=3D""><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">Hello,<div><br></div><div>Instead of writing a long list of =
variables with 'auto':</div><div><br></div><div>/* Here we create v=
ariables for bla bla */</div><div>auto X1 =3D new X();</div><div>auto X2 =
=3D new X("bla bla");</div><div>....</div><div><br></div><div>The=
following new syntax could be create a more compact code:</div><div><br></=
div><div><span style=3D"font-size:13px">auto {</span><br></div><div style=
=3D"font-size:12.8000001907349px">=C2=A0 =C2=A0X1 =3D new X();</div><div st=
yle=3D"font-size:12.8000001907349px"><span style=3D"font-size:12.8000001907=
349px">=C2=A0 =C2=A0X2 =3D new X("bla bla");</span></div><div><sp=
an style=3D"font-size:13px">=C2=A0 ...</span><br></div><div><span style=3D"=
font-size:13px">=C2=A0 =C2=A0Xn =3D ..</span></div><div>}</div></div></bloc=
kquote><div><br></div></span><div>The problem with this is that it looks mi=
sleading, since { usually introduces a scope, but this would be an exceptio=
n to that rule.</div><div><br></div><div>Regards=C2=A0</div><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"><div>Thanks for reading</div><div=
><br></div></div></blockquote></div></blockquote></div><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--047d7b4145fc1c96180506f35c77--
.
Author: Douglas Boffey <douglas.boffey@gmail.com>
Date: Mon, 3 Nov 2014 04:22:27 -0800 (PST)
Raw View
------=_Part_288_593523178.1415017347775
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Monday, 3 November 2014 12:19:37 UTC, michael paris wrote:=20
>
> yep, an exception!
>
> main() {
> auto {
> a =3D 2 + 3;
> x =3D new X();
>
> {
> int b =3D a + 5;
> }
>
> //here b is out of scope!
>
> //But if i declare b using 'auto' in this way:
> auto {
> b =3D a + 5;
> }
>
> new_var =3D b + a; //b is visible
>
> {
> auto example =3D 2;
> }
>
> //here example is out of scope!
> }
> }
>
> =20
>
Looks too much like those languages where variables don=E2=80=99t need decl=
aring=20
for my liking :(
--=20
---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_288_593523178.1415017347775
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><BR>On Monday, 3 November 2014 12:19:37 UTC, michael paris=
wrote:=20
<BLOCKQUOTE style=3D"BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class=3Dgmail_quote>
<DIV dir=3Dltr><SPAN style=3D"FONT-FAMILY: arial, sans-serif; FONT-SIZE: 12=
..66px">yep, an exception!</SPAN><BR>
<DIV><BR></DIV>
<DIV>
<DIV>main() {</DIV>
<DIV>auto {</DIV>
<DIV><SPAN style=3D"WHITE-SPACE: pre"></SPAN>a =3D 2 + 3;</DIV>
<DIV><SPAN style=3D"WHITE-SPACE: pre"></SPAN>x =3D new X();</DIV>
<DIV><BR></DIV>
<DIV><SPAN style=3D"WHITE-SPACE: pre"></SPAN>{</DIV>
<DIV><SPAN style=3D"WHITE-SPACE: pre"></SPAN> int b =3D a + 5;</DIV>
<DIV><SPAN style=3D"WHITE-SPACE: pre"></SPAN>}</DIV>
<DIV><BR></DIV>
<DIV><SPAN style=3D"WHITE-SPACE: pre"></SPAN>//here b is out of scope!</DIV=
>
<DIV><BR></DIV>
<DIV><SPAN style=3D"WHITE-SPACE: pre"></SPAN>//But if i declare b using 'au=
to' in this way:</DIV>
<DIV><SPAN style=3D"WHITE-SPACE: pre"></SPAN>auto {</DIV>
<DIV><SPAN style=3D"WHITE-SPACE: pre"></SPAN>b =3D a + 5;</DIV>
<DIV><SPAN style=3D"WHITE-SPACE: pre"></SPAN>}</DIV>
<DIV><BR></DIV>
<DIV><SPAN style=3D"WHITE-SPACE: pre"></SPAN>new_var =3D b + a; //b is visi=
ble</DIV>
<DIV><BR></DIV>
<DIV><SPAN style=3D"WHITE-SPACE: pre"></SPAN>{</DIV>
<DIV> auto example =3D 2;</DIV>
<DIV><SPAN style=3D"WHITE-SPACE: pre"></SPAN>}</DIV>
<DIV><BR></DIV>
<DIV><SPAN style=3D"WHITE-SPACE: pre"></SPAN>//here example is out of scope=
!</DIV>
<DIV>}</DIV>
<DIV>}</DIV></DIV></DIV>
<DIV><BR> </DIV></BLOCKQUOTE>
<DIV>Looks too much like those languages where variables don=E2=80=99t need=
declaring for my liking :(</DIV></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_288_593523178.1415017347775--
.
Author: =?UTF-8?Q?Germ=C3=A1n_Diago?= <germandiago@gmail.com>
Date: Mon, 3 Nov 2014 04:44:02 -0800 (PST)
Raw View
------=_Part_1692_1924291519.1415018643003
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
El lunes, 3 de noviembre de 2014 19:19:37 UTC+7, michael paris escribi=C3=
=B3:
>
> yep, an exception!
>
> main() {
> auto {
> a =3D 2 + 3;
> x =3D new X();
>
> {
> int b =3D a + 5;
> }
>
> //here b is out of scope!
>
> //But if i declare b using 'auto' in this way:
> auto {
> b =3D a + 5;
> }
>
> new_var =3D b + a; //b is visible
>
> {
> auto example =3D 2;
> }
>
> //here example is out of scope!
> }
>
>
You changed exception by inconsistency:
int a, b, c; //as always
auto a =3D 7, b =3D "hello"; //Illegal currently.
auto { //What?
a =3D ...;
b =3D ...;
}
Regards
--=20
---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_1692_1924291519.1415018643003
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>El lunes, 3 de noviembre de 2014 19:19:37 UTC+7, m=
ichael paris escribi=C3=B3:<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"><span style=3D"font-family:arial,sans-serif;font-size:12.666=
6669845581px">yep, an exception!</span><br><div><br></div><div><div>main() =
{</div><div>auto {</div><div><span style=3D"white-space:pre"> </span>a =3D =
2 + 3;</div><div><span style=3D"white-space:pre"> </span>x =3D new X();</di=
v><div><br></div><div><span style=3D"white-space:pre"> </span>{</div><div><=
span style=3D"white-space:pre"> </span> int b =3D a + 5;</div><div><s=
pan style=3D"white-space:pre"> </span>}</div><div><br></div><div><span styl=
e=3D"white-space:pre"> </span>//here b is out of scope!</div><div><br></div=
><div><span style=3D"white-space:pre"> </span>//But if i declare b using 'a=
uto' in this way:</div><div><span style=3D"white-space:pre"> </span>auto {<=
/div><div><span style=3D"white-space:pre"> </span>b =3D a + 5;</div><div><=
span style=3D"white-space:pre"> </span>}</div><div><br></div><div><span sty=
le=3D"white-space:pre"> </span>new_var =3D b + a; //b is visible</div><div>=
<br></div><div><span style=3D"white-space:pre"> </span>{</div><div> &=
nbsp; auto example =3D 2;</div><div><span style=
=3D"white-space:pre"> </span>}</div><div><br></div><div><span style=3D"whit=
e-space:pre"> </span>//here example is out of scope!</div><div>}</div><div>=
<br></div></div></div></blockquote><div><br></div><div>You changed exceptio=
n by inconsistency:</div><div><br></div><div>int a, b, c; //as always</div>=
<div><br></div><div>auto a =3D 7, b =3D "hello"; //Illegal currently.</div>=
<div><br></div><div>auto { //What?</div><div> a =3D ...;</div>=
<div> b =3D ...;</div><div>}</div><div><br></div><div>Regards<=
/div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_1692_1924291519.1415018643003--
.
Author: =?UTF-8?Q?Germ=C3=A1n_Diago?= <germandiago@gmail.com>
Date: Mon, 3 Nov 2014 04:45:01 -0800 (PST)
Raw View
------=_Part_1673_885325988.1415018701111
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
I didnt elaborate: by inconsistency I mean that variable declaration=20
currently does not introduce a scope.
With your rule, the way you show it, auto { creates a new scope.
El lunes, 3 de noviembre de 2014 19:44:03 UTC+7, Germ=C3=A1n Diago escribi=
=C3=B3:
>
>
>
> El lunes, 3 de noviembre de 2014 19:19:37 UTC+7, michael paris escribi=C3=
=B3:
>>
>> yep, an exception!
>>
>> main() {
>> auto {
>> a =3D 2 + 3;
>> x =3D new X();
>>
>> {
>> int b =3D a + 5;
>> }
>>
>> //here b is out of scope!
>>
>> //But if i declare b using 'auto' in this way:
>> auto {
>> b =3D a + 5;
>> }
>>
>> new_var =3D b + a; //b is visible
>>
>> {
>> auto example =3D 2;
>> }
>>
>> //here example is out of scope!
>> }
>>
>>
> You changed exception by inconsistency:
>
> int a, b, c; //as always
>
> auto a =3D 7, b =3D "hello"; //Illegal currently.
>
> auto { //What?
> a =3D ...;
> b =3D ...;
> }
>
> Regards
>
--=20
---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_1673_885325988.1415018701111
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I didnt elaborate: by inconsistency I mean that variable d=
eclaration currently does not introduce a scope.<div><br></div><div>With yo=
ur rule, the way you show it, auto { creates a new scope.<br><br>El lunes, =
3 de noviembre de 2014 19:44:03 UTC+7, Germ=C3=A1n Diago escribi=C3=B3:<bl=
ockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border=
-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><br><br>El lunes=
, 3 de noviembre de 2014 19:19:37 UTC+7, michael paris escribi=C3=B3:<bloc=
kquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-lef=
t:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><span style=3D"font-fam=
ily:arial,sans-serif;font-size:12.6666669845581px">yep, an exception!</span=
><br><div><br></div><div><div>main() {</div><div>auto {</div><div><span sty=
le=3D"white-space:pre"> </span>a =3D 2 + 3;</div><div><span style=3D"white-=
space:pre"> </span>x =3D new X();</div><div><br></div><div><span style=3D"w=
hite-space:pre"> </span>{</div><div><span style=3D"white-space:pre"> </span=
> int b =3D a + 5;</div><div><span style=3D"white-space:pre"> </span>=
}</div><div><br></div><div><span style=3D"white-space:pre"> </span>//here b=
is out of scope!</div><div><br></div><div><span style=3D"white-space:pre">=
</span>//But if i declare b using 'auto' in this way:</div><div><span styl=
e=3D"white-space:pre"> </span>auto {</div><div><span style=3D"white-space:p=
re"> </span>b =3D a + 5;</div><div><span style=3D"white-space:pre"> </span=
>}</div><div><br></div><div><span style=3D"white-space:pre"> </span>new_var=
=3D b + a; //b is visible</div><div><br></div><div><span style=3D"white-sp=
ace:pre"> </span>{</div><div> auto=
example =3D 2;</div><div><span style=3D"white-space:pre"> </span>}</div><d=
iv><br></div><div><span style=3D"white-space:pre"> </span>//here example is=
out of scope!</div><div>}</div><div><br></div></div></div></blockquote><di=
v><br></div><div>You changed exception by inconsistency:</div><div><br></di=
v><div>int a, b, c; //as always</div><div><br></div><div>auto a =3D 7, b =
=3D "hello"; //Illegal currently.</div><div><br></div><div>auto { //What?</=
div><div> a =3D ...;</div><div> b =3D ...;</div><=
div>}</div><div><br></div><div>Regards</div></div></blockquote></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_1673_885325988.1415018701111--
.
Author: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@gmail.com>
Date: Mon, 3 Nov 2014 14:09:10 +0100
Raw View
2014-11-03 11:44 GMT+01:00 <michaelparis314@gmail.com>:
> Hello,
>
> Instead of writing a long list of variables with 'auto':
Are you consequently suggesting this syntax for other variable forms
as well? Because I don't understand why auto should be more special
than others.
> /* Here we create variables for bla bla */
> auto X1 = new X();
> auto X2 = new X("bla bla");
> ....
>
> The following new syntax could be create a more compact code:
>
> auto {
> X1 = new X();
> X2 = new X("bla bla");
> ...
> Xn = ..
> }
This doesn't look like a serious improvement to me. To the contrary:
This makes the language unnecessary complicated and I have to tell
beginners another complete new rule about how to declare variables.
- Daniel
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: sgheeren@gmail.com
Date: Mon, 3 Nov 2014 06:05:06 -0800 (PST)
Raw View
------=_Part_420_1572727300.1415023506067
Content-Type: text/plain; charset=UTF-8
On Monday, November 3, 2014 11:44:13 AM UTC+1, michael...@gmail.com wrote:
>
> Hello,
>
> Instead of writing a long list of variables with 'auto':
>
>
As others would phrase it: _what problem does it solve_? (We already have
some inkling about the cost)
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_420_1572727300.1415023506067
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Monday, November 3, 2014 11:44:13 AM UTC+1, michael...@=
gmail.com 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"lt=
r">Hello,<div><br></div><div>Instead of writing a long list of variables wi=
th 'auto':</div><div><br></div></div></blockquote><div> </div><span st=
yle=3D"font-size: 13.3333330154419px;">As others would phrase it: _what pro=
blem does it solve_? (We already have some inkling about the cost)</span><b=
r style=3D"font-size: 13.3333330154419px;"><br style=3D"font-size: 13.33333=
30154419px;"><div><br></div><div> </div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_420_1572727300.1415023506067--
.
Author: michael paris <michaelparis314@gmail.com>
Date: Mon, 3 Nov 2014 16:03:00 +0100
Raw View
--047d7b4145fc86c66f0506f5a4a8
Content-Type: text/plain; charset=UTF-8
Here is the idea:
main() {
typename_with_long_name a = ...
typename_with_long_name b = ...
typename_with_long_name c = ...
//With standard use of auto:
auto a = ...
auto b = ...
auto c = ...
//Adding to 'auto' a new rule:
auto {
a = ...
b = ...
c = ...
}
}
We use auto for two main raisons:
1) Resolving situation like :
template<class T, class U>
auto add(T t, U u) -> decltype(t + u)
{
return t + u;
}
2) Reduce the amount of code we write every day:
instead of writing something like
std::shared_ptr<std::map<std::string, SuperLongLongName>> variable = ...
just writing in place (when possible)
auto variable = ....
So, what problem does it solve ?
just reducing the amount of "auto" we write every day and create logical
places in the code that are "typed declaration free".
Look this simple code:
/* standard way */
auto sum_int = 3 + 4;
auto sum_str = "hey" + "hey";
auto sum_float = 3.14 + 1.6;
auto &data = func_ret();
/* new way */
auto {
sum_int = 3 + 4;
sum_str = "hey" + "hey";
sum_float = 3.14 + 1.6;
&data = func_ret();
}
For my personal taste, the new way is more elegant and compact.
2014-11-03 15:05 GMT+01:00 <sgheeren@gmail.com>:
> On Monday, November 3, 2014 11:44:13 AM UTC+1, michael...@gmail.com wrote:
>>
>> Hello,
>>
>> Instead of writing a long list of variables with 'auto':
>>
>>
> As others would phrase it: _what problem does it solve_? (We already have
> some inkling about the cost)
>
>
>
>
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--047d7b4145fc86c66f0506f5a4a8
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Here is the idea:</div><div><br></div><div>main() {<s=
pan class=3D"" style=3D"white-space:pre"> </span></div><div><span class=3D"=
" style=3D"white-space:pre"> </span>typename_with_long_name a =3D ...=C2=A0=
</div><div><span class=3D"" style=3D"white-space:pre"> </span>typename_with=
_long_name b =3D ...</div><div><span class=3D"" style=3D"white-space:pre"> =
</span>typename_with_long_name c =3D ...=C2=A0</div><div><br></div><div><sp=
an class=3D"" style=3D"white-space:pre"> </span>//With standard use of auto=
:</div><div><span class=3D"" style=3D"white-space:pre"> </span>auto a =3D .=
...</div><div><span class=3D"" style=3D"white-space:pre"> </span>auto b =3D =
....</div><div><span class=3D"" style=3D"white-space:pre"> </span>auto c =3D=
...</div><div><br></div><div><span class=3D"" style=3D"white-space:pre"> <=
/span>//Adding to 'auto' a new rule:</div><div><span class=3D"" sty=
le=3D"white-space:pre"> </span>auto {</div><div><span class=3D"" style=3D"w=
hite-space:pre"> </span>a =3D ...</div><div><span class=3D"" style=3D"whit=
e-space:pre"> </span>b =3D ...</div><div><span class=3D"" style=3D"white-s=
pace:pre"> </span>c =3D ...</div><div><span class=3D"" style=3D"white-spac=
e:pre"> </span>}</div><div>}</div><div><br></div><div>We use auto for two m=
ain raisons:</div><div>1) Resolving situation like :</div><div><br></div><d=
iv>template<class T, class U></div><div>auto add(T t, U u) -> decl=
type(t + u)</div><div>{</div><div>=C2=A0 =C2=A0 return t + u;</div><div>}</=
div><div><br></div><div>2) Reduce the amount of code we write every day:</d=
iv><div>instead of writing something like</div><div>=C2=A0 std::shared_ptr&=
lt;std::map<std::string, SuperLongLongName>> variable =3D ...</div=
><div>just writing in place (when possible)</div><div>=C2=A0 auto variable =
=3D .... =C2=A0</div><div><br></div><div><br></div><div>=C2=A0So, what prob=
lem does it solve ?</div><div>=C2=A0just reducing the amount of "auto&=
quot; we write every day and create logical places in the code that are &qu=
ot;typed declaration free".</div><div><br></div><div><br></div><div>Lo=
ok this simple code:</div><div><br></div><div>/* standard way */</div><div>=
auto sum_int =3D 3 + 4;</div><div>auto sum_str =3D "hey" + "=
hey";</div><div>auto sum_float =3D 3.14 + 1.6;</div><div>auto &dat=
a =3D func_ret();</div><div><br></div><div>/* new way */</div><div>auto {</=
div><div><span class=3D"" style=3D"white-space:pre"> </span>sum_int =3D 3 +=
4;</div><div><span class=3D"" style=3D"white-space:pre"> </span>sum_str =
=3D "hey" + "hey";<span class=3D"" style=3D"white-space=
:pre"> </span></div><div><span class=3D"" style=3D"white-space:pre"> </span=
>sum_float =3D 3.14 + 1.6;</div><div><span class=3D"" style=3D"white-space:=
pre"> </span>&data =3D func_ret();</div><div>}</div><div><br></div><div=
>For my personal taste, the new way is more elegant and compact.</div><div>=
<br></div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">2=
014-11-03 15:05 GMT+01:00 <span dir=3D"ltr"><<a href=3D"mailto:sgheeren=
@gmail.com" target=3D"_blank">sgheeren@gmail.com</a>></span>:<br><blockq=
uote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc =
solid;padding-left:1ex"><div dir=3D"ltr"><span class=3D"">On Monday, Novemb=
er 3, 2014 11:44:13 AM UTC+1, <a href=3D"mailto:michael...@gmail.com" targe=
t=3D"_blank">michael...@gmail.com</a> wrote:<blockquote class=3D"gmail_quot=
e" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-l=
eft:1ex"><div dir=3D"ltr">Hello,<div><br></div><div>Instead of writing a lo=
ng list of variables with 'auto':</div><div><br></div></div></block=
quote><div>=C2=A0</div></span><span style=3D"font-size:13.3333330154419px">=
As others would phrase it: _what problem does it solve_? (We already have s=
ome inkling about the cost)</span><br style=3D"font-size:13.3333330154419px=
"><br style=3D"font-size:13.3333330154419px"><div><br></div><div>=C2=A0</di=
v></div></blockquote></div><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--047d7b4145fc86c66f0506f5a4a8--
.
Author: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@gmail.com>
Date: Mon, 3 Nov 2014 16:29:52 +0100
Raw View
2014-11-03 16:03 GMT+01:00 michael paris <michaelparis314@gmail.com>:
> Look this simple code:
>
> /* standard way */
> auto sum_int = 3 + 4;
> auto sum_str = "hey" + "hey";
> auto sum_float = 3.14 + 1.6;
> auto &data = func_ret();
>
> /* new way */
> auto {
> sum_int = 3 + 4;
> sum_str = "hey" + "hey";
> sum_float = 3.14 + 1.6;
> &data = func_ret();
> }
>
> For my personal taste, the new way is more elegant and compact.
I still disagree. I see no visible advantage of the suggested new
rule. It does not make the code more readable compared to the current
state. In fact, it makes it harder to understand, because instead of
an initialization, your code form looks like an assignment. Again, I
emphasize that your new rule is completely different than existing
initialization rules and this means it has to be taught to every
programmer. If there would exist a real advantage, the latter can
outweigh the disadvantages of new rules. But from your presentation I
really don't see any convincing argument that would clarify the
advantages of the new rule.
- Daniel
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: gmisocpp@gmail.com
Date: Mon, 3 Nov 2014 12:12:56 -0800 (PST)
Raw View
------=_Part_1966_212951558.1415045576476
Content-Type: text/plain; charset=UTF-8
On Monday, November 3, 2014 11:44:13 PM UTC+13, michael...@gmail.com wrote:
>
> Hello,
>
> Instead of writing a long list of variables with 'auto':
>
> /* Here we create variables for bla bla */
> auto X1 = new X();
> auto X2 = new X("bla bla");
> ....
>
> The following new syntax could be create a more compact code:
>
> auto {
> X1 = new X();
> X2 = new X("bla bla");
> ...
> Xn = ..
> }
>
> Thanks for reading
>
>
I can see some appeal in reduced typing, but I don't think the feature is
worth it and every time I've started to feel the need for that feature I
realised auto was the problem and overall it seems to me that:
a) it encourages excess use of auto which I dislike, e.g. auto a = 1;
doesn't appeal to me over int a = 1;
b) it introduces a new syntax to learn.in an area not desperate for one.
c) I don't like indentation where it isn't a scope unless there's important
some value to it.
d) I can't do anything really new with it to warrant the distraction of the
committee to work on it to introduce it.
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_1966_212951558.1415045576476
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Monday, November 3, 2014 11:44:13 PM UTC+13, mi=
chael...@gmail.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin:=
0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204=
); border-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr">Hell=
o,<div><br></div><div>Instead of writing a long list of variables with 'aut=
o':</div><div><br></div><div>/* Here we create variables for bla bla */</di=
v><div>auto X1 =3D new X();</div><div>auto X2 =3D new X("bla bla");</div><d=
iv>....</div><div><br></div><div>The following new syntax could be create a=
more compact code:</div><div><br></div><div><span style=3D"font-size: 13px=
;">auto {</span><br></div><div style=3D"font-size: 12.8px;"> X1=
=3D new X();</div><div style=3D"font-size: 12.8px;"><span style=3D"font-si=
ze: 12.8px;"> X2 =3D new X("bla bla");</span></div><div><span s=
tyle=3D"font-size: 13px;"> ...</span><br></div><div><span style=3D"fo=
nt-size: 13px;"> Xn =3D ..</span></div><div>}</div><div><br></d=
iv><div>Thanks for reading</div><div><br></div></div></blockquote><div>&nbs=
p;</div><div>I can see some appeal in reduced typing, but I don't thin=
k the feature is worth it and every time I've started to feel the need for =
that feature I realised auto was the problem and overall it seems to m=
e that:</div><div>a) it encourages excess use of auto which I dislike, =
;e.g. auto a =3D 1; doesn't appeal to me over int a =3D 1;</div><div>b=
) it introduces a new syntax to learn.in an area not desperate for one.</di=
v><div>c) I don't like indentation where it isn't a scope unless there's im=
portant some value to it.</div><div>d) I can't do anything really new with =
it to warrant the distraction of the committee to work on it to introd=
uce it.</div><div><br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_1966_212951558.1415045576476--
.
Author: Andy Prowl <andy.prowl@gmail.com>
Date: Tue, 4 Nov 2014 05:02:48 -0800 (PST)
Raw View
------=_Part_483_219425507.1415106169000
Content-Type: text/plain; charset=UTF-8
I think saving keystrokes is rarely a good motivation for anything. Writing
"auto x =" instead of just "x =" makes code easier to read, because it
clearly says "I'm declaring a variable" rather than "I"m assigning a
variable", and the "auto" part makes this clear. The proposed syntax
requires the reader to disambiguate assignment from initialization based on
the context (are we inside an "auto" block or not?).
Having "auto" blocks is also inconsistent and confusing (why introducing
unnecessary exceptions to the scoping rules? why only for "auto" and not
for "int"?), and makes it harder to teach the rules.
The thing I would rather wish is a better syntax for variable
initialization. The AAA style cannot be used consistently (see non-movable
types), and I would love to see a uniform way of initializing variables.
Thinking aloud:
x := val;
Or even:
x := type{val};
Or why not:
x : type = val;
But this is not the point of this thread.
Kind regards,
Andy
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_483_219425507.1415106169000
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I think saving keystrokes is rarely a good motivation for =
anything. Writing "auto x =3D" instead of just "x =3D" makes code easier to=
read, because it clearly says "I'm declaring a variable" rather than "I"m =
assigning a variable", and the "auto" part makes this clear. The proposed s=
yntax requires the reader to disambiguate assignment from initialization ba=
sed on the context (are we inside an "auto" block or not?).<br><span style=
=3D"font-size: 13px;"><br>Having "auto" blocks is also inconsistent and con=
fusing (why introducing unnecessary exceptions to the scoping rules? <=
/span><span style=3D"font-size: 13.3333330154419px;">why only for "auto" an=
d not for "int"?</span><span style=3D"font-size: 13px;">), and makes it har=
der to teach the rules.<br><br>The thing I would rather wish is a bett=
er syntax for variable initialization. The AAA style cannot be used consist=
ently (see non-movable types), and I would love to see a uniform way of ini=
tializing variables.</span><div><span style=3D"font-size: 13px;"><br></span=
></div><div><span style=3D"font-size: 13px;">Thinking aloud:<br><br><div cl=
ass=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 187); word-wra=
p: break-word; background-color: rgb(250, 250, 250);"><code class=3D"pretty=
print"><div class=3D"subprettyprint"><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> x </span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">:=3D</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> val</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">;</span></div></code></div><br>Or even:<br><br><div class=3D"=
prettyprint" style=3D"border: 1px solid rgb(187, 187, 187); word-wrap: brea=
k-word; background-color: rgb(250, 250, 250);"><code class=3D"prettyprint">=
<div class=3D"subprettyprint"><span class=3D"styled-by-prettify"><div class=
=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 187); word-wrap: =
break-word; background-color: rgb(250, 250, 250);"><code class=3D"prettypri=
nt"><div class=3D"subprettyprint"><font color=3D"#660066"> x :=
=3D type{val};</font></div></code></div></span></div></code></div><br></spa=
n><div><span style=3D"font-size: 13px;">Or why not:</span></div><div><span =
style=3D"font-size: 13px;"><br></span></div><div><span style=3D"font-size: =
13px;"><div class=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, =
187); word-wrap: break-word; background-color: rgb(250, 250, 250);"><code c=
lass=3D"prettyprint"><div class=3D"subprettyprint"><font color=3D"#660066">=
x : type =3D val;</font></div></code></div></span></div></div=
><br><div><span style=3D"font-size: 13px;">But this is not the point of thi=
s thread.<br><br>Kind regards,<br><br>Andy<br><br></span></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_483_219425507.1415106169000--
.
Author: Farid Mehrabi <farid.mehrabi@gmail.com>
Date: Wed, 5 Nov 2014 22:08:47 +0330
Raw View
--001a11c3a16a188daf050720e509
Content-Type: text/plain; charset=UTF-8
I `m not going to discuss whether it`s a good or bad idea but IMHO maybe
the following syntax looks more comprehensible:
auto a1=X1(), a2=X2();
it reminds me of the old combined declaration syntax:
int i1=1, i2=2;
regards,
FM.
2014-11-03 14:14 GMT+03:30 <michaelparis314@gmail.com>:
> Hello,
>
> Instead of writing a long list of variables with 'auto':
>
> /* Here we create variables for bla bla */
> auto X1 = new X();
> auto X2 = new X("bla bla");
> ....
>
> The following new syntax could be create a more compact code:
>
> auto {
> X1 = new X();
> X2 = new X("bla bla");
> ...
> Xn = ..
> }
>
> Thanks for reading
>
> --
>
> ---
> 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.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>
--
how am I supposed to end the twisted road of your hair in the dark night??
unless the candle of your face does turn a lamp up on my way!!!
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--001a11c3a16a188daf050720e509
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"rtl"><div dir=3D"ltr">I `m not going to discuss whether it`s a =
good or bad idea but IMHO maybe the following syntax looks more comprehensi=
ble:</div><div dir=3D"ltr"><br></div><div dir=3D"ltr">auto a1=3DX1(), a2=3D=
X2();</div><div dir=3D"ltr"><br></div><div dir=3D"ltr">it reminds me of the=
old combined declaration syntax:</div><div dir=3D"ltr"><br></div><div dir=
=3D"ltr">int i1=3D1, i2=3D2;</div><div dir=3D"ltr"><br></div><div dir=3D"lt=
r">regards,</div><div dir=3D"ltr">FM.</div><div dir=3D"ltr"><br></div></div=
><div class=3D"gmail_extra"><br><div class=3D"gmail_quote"><div dir=3D"ltr"=
>2014-11-03 14:14 GMT+03:30 <span dir=3D"ltr"><<a href=3D"mailto:michae=
lparis314@gmail.com" target=3D"_blank">michaelparis314@gmail.com</a>></s=
pan>:</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bor=
der-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hello,<div><br><=
/div><div>Instead of writing a long list of variables with 'auto':<=
/div><div><br></div><div>/* Here we create variables for bla bla */</div><d=
iv>auto X1 =3D new X();</div><div>auto X2 =3D new X("bla bla");</=
div><div>....</div><div><br></div><div>The following new syntax could be cr=
eate a more compact code:</div><div><br></div><div><span style=3D"font-size=
:13px">auto {</span><br></div><div style=3D"font-size:12.8000001907349px">=
=C2=A0 =C2=A0X1 =3D new X();</div><div style=3D"font-size:12.8000001907349p=
x"><span style=3D"font-size:12.8000001907349px">=C2=A0 =C2=A0X2 =3D new X(&=
quot;bla bla");</span></div><div><span style=3D"font-size:13px">=C2=A0=
...</span><br></div><div><span style=3D"font-size:13px">=C2=A0 =C2=A0Xn =
=3D ..</span></div><div>}</div><div><br></div><div>Thanks for reading</div>=
<span class=3D"HOEnZb"><font color=3D"#888888"><div><br></div></font></span=
></div><span class=3D"HOEnZb"><font color=3D"#888888">
<p></p>
-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;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" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</font></span></blockquote></div><br><br clear=3D"all"><div><br></div>-- <b=
r><div class=3D"gmail_signature"><div dir=3D"ltr">how am I supposed to end =
the twisted road of=C2=A0 your hair in the dark night??<br>unless the candl=
e of your face does turn a lamp up on my way!!!<br></div></div>
</div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a11c3a16a188daf050720e509--
.
Author: Bengt Gustafsson <bengt.gustafsson@beamways.com>
Date: Wed, 5 Nov 2014 14:59:44 -0800 (PST)
Raw View
That's how I always wanted auto to work, assuming you mean that X1 and X2 are two classes and not two functions returning int.
This is especially good for for-init statements, working with two iterators or so.
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.