Topic: Adding assignmnet operator with parameter of type
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 5 Dec 2013 04:16:25 -0800 (PST)
Raw View
------=_Part_1829_7642439.1386245785709
Content-Type: text/plain; charset=ISO-8859-1
If I am not mistaken aggregates may have user-defined assignment operators.
I would propose to define assignment operator with parameter of type
std::initializer_list for class std::array. It would make using of
std:;array more popular.
For example
std:;array<int, 3> a;
if ( today == "Monday" ) a = { 1, 2, 3 };
else if ( today == "Tuesday" ) a = { 3, 2, 1 };
else if ( today == "Friday" ) a = { 0, 0, 0 };
--
---
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_1829_7642439.1386245785709
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>If I am not mistaken aggregates may have user-defined=
assignment operators. I would propose to define assignment operator with p=
arameter of type std::initializer_list for class std::array. It would make =
using of std:;array more popular.</div><div>For example</div><div> </d=
iv><div>std:;array<int, 3> a;</div><div> </div><div>if ( today =
=3D=3D "Monday" ) a =3D { 1, 2, 3 };</div><div>else if ( today =3D=3D "Tues=
day" ) a =3D { 3, 2, 1 };</div><div>else if ( today =3D=3D "Friday" ) a =3D=
{ 0, 0, 0 };</div><div> </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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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_1829_7642439.1386245785709--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 5 Dec 2013 07:38:13 -0800 (PST)
Raw View
------=_Part_2012_32533179.1386257893451
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
The only problem I see is that there is no possibility to report that the=
=20
number of initializers is greater than the size of an array at compilation=
=20
time.
=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=C2=D2=D1 2013 =C7., 16:16:25 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
=CE=C1=D0=C9=D3=C1=CC:
> If I am not mistaken aggregates may have user-defined assignment=20
> operators. I would propose to define assignment operator with parameter o=
f=20
> type std::initializer_list for class std::array. It would make using of=
=20
> std:;array more popular.
> For example
> =20
> std:;array<int, 3> a;
> =20
> if ( today =3D=3D "Monday" ) a =3D { 1, 2, 3 };
> else if ( today =3D=3D "Tuesday" ) a =3D { 3, 2, 1 };
> else if ( today =3D=3D "Friday" ) a =3D { 0, 0, 0 };
> =20
> =20
>
--=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_2012_32533179.1386257893451
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>The only problem I see is that there is no possibilit=
y to report that the number of initializers is greater than the size of an =
array at compilation time.</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=
=C1=C2=D2=D1 2013 =C7., 16:16:25 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=
=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gm=
ail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-le=
ft-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: so=
lid;"><div dir=3D"ltr"><div>If I am not mistaken aggregates may have user-d=
efined assignment operators. I would propose to define assignment operator =
with parameter of type std::initializer_list for class std::array. It would=
make using of std:;array more popular.</div><div>For example</div><div>&nb=
sp;</div><div>std:;array<int, 3> a;</div><div> </div><div>if ( t=
oday =3D=3D "Monday" ) a =3D { 1, 2, 3 };</div><div>else if ( today =3D=3D =
"Tuesday" ) a =3D { 3, 2, 1 };</div><div>else if ( today =3D=3D "Friday" ) =
a =3D { 0, 0, 0 };</div><div> </div><div> </div></div></blockquot=
e></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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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_2012_32533179.1386257893451--
.
Author: Roman Perepelitsa <roman.perepelitsa@gmail.com>
Date: Thu, 5 Dec 2013 16:45:08 +0100
Raw View
--bcaec5485aa03d581f04eccb6b8d
Content-Type: text/plain; charset=ISO-8859-1
2013/12/5 Vlad from Moscow <vlad.moscow@mail.ru>
> If I am not mistaken aggregates may have user-defined assignment
> operators. I would propose to define assignment operator with parameter of
> type std::initializer_list for class std::array. It would make using of
> std:;array more popular.
> For example
>
> std:;array<int, 3> a;
>
> if ( today == "Monday" ) a = { 1, 2, 3 };
> else if ( today == "Tuesday" ) a = { 3, 2, 1 };
> else if ( today == "Friday" ) a = { 0, 0, 0 };
>
I believe this is valid C++11 code (modulo s/:;/::/ in the definition of
the array). If your compiler rejects it, try double curlies: a = {{1, 2,
3}}.
Roman.
--
---
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/.
--bcaec5485aa03d581f04eccb6b8d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">2013=
/12/5 Vlad from Moscow <span dir=3D"ltr"><<a href=3D"mailto:vlad.moscow@=
mail.ru" target=3D"_blank">vlad.moscow@mail.ru</a>></span><br><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex">
<div dir=3D"ltr"><div>If I am not mistaken aggregates may have user-defined=
assignment operators. I would propose to define assignment operator with p=
arameter of type std::initializer_list for class std::array. It would make =
using of std:;array more popular.</div>
<div>For example</div><div>=A0</div><div>std:;array<int, 3> a;</div><=
div>=A0</div><div>if ( today =3D=3D "Monday" ) a =3D { 1, 2, 3 };=
</div><div>else if ( today =3D=3D "Tuesday" ) a =3D { 3, 2, 1 };<=
/div><div>else if ( today =3D=3D "Friday" ) a =3D { 0, 0, 0 };</d=
iv>
</div></blockquote><div><br></div><div>I believe this is valid C++11 code (=
modulo s/:;/::/ in the definition of the array). If your compiler rejects i=
t, try double curlies: a =3D {{1, 2, 3}}.</div><div><br></div><div>Roman.</=
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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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 />
--bcaec5485aa03d581f04eccb6b8d--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 5 Dec 2013 08:06:13 -0800 (PST)
Raw View
------=_Part_1553_21179500.1386259573828
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
I did not know this. Could you point out corresponding sections of the C++=
=20
Standard that regulate this?
=20
=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=C2=D2=D1 2013 =C7., 19:45:08 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Roman Perepelitsa=20
=CE=C1=D0=C9=D3=C1=CC:
> 2013/12/5 Vlad from Moscow <vlad....@mail.ru <javascript:>>
>
>> If I am not mistaken aggregates may have user-defined assignment=20
>> operators. I would propose to define assignment operator with parameter =
of=20
>> type std::initializer_list for class std::array. It would make using of=
=20
>> std:;array more popular.
>> For example
>> =20
>> std:;array<int, 3> a;
>> =20
>> if ( today =3D=3D "Monday" ) a =3D { 1, 2, 3 };
>> else if ( today =3D=3D "Tuesday" ) a =3D { 3, 2, 1 };
>> else if ( today =3D=3D "Friday" ) a =3D { 0, 0, 0 };
>>
>
> I believe this is valid C++11 code (modulo s/:;/::/ in the definition of=
=20
> the array). If your compiler rejects it, try double curlies: a =3D {{1, 2=
,=20
> 3}}.
>
> Roman.
> =20
--=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_1553_21179500.1386259573828
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>I did not know this. Could you point out correspondin=
g sections of the C++ Standard that regulate this?</div><div> </div><d=
iv>=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=C2=D2=D1 2013 =C7., 19:45:08 =
UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Roman Perepelitsa =CE=C1=D0=C9=
=D3=C1=CC:</div><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"><div><div cla=
ss=3D"gmail_quote">2013/12/5 Vlad from Moscow <span dir=3D"ltr"><<a onmo=
usedown=3D"this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'=
javascript:';return true;" href=3D"javascript:" target=3D"_blank" gdf-obfus=
cated-mailto=3D"2hBZeWC-aZkJ">vlad....@mail.ru</a>></span><br><blockquot=
e class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1=
ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-l=
eft-style: solid;">
<div dir=3D"ltr"><div>If I am not mistaken aggregates may have user-defined=
assignment operators. I would propose to define assignment operator with p=
arameter of type std::initializer_list for class std::array. It would make =
using of std:;array more popular.</div>
<div>For example</div><div> </div><div>std:;array<int, 3> a;</di=
v><div> </div><div>if ( today =3D=3D "Monday" ) a =3D { 1, 2, 3 };</di=
v><div>else if ( today =3D=3D "Tuesday" ) a =3D { 3, 2, 1 };</div><div>else=
if ( today =3D=3D "Friday" ) a =3D { 0, 0, 0 };</div>
</div></blockquote><div><br></div><div>I believe this is valid C++11 code (=
modulo s/:;/::/ in the definition of the array). If your compiler rejects i=
t, try double curlies: a =3D {{1, 2, 3}}.</div><div><br></div><div>Roman.</=
div>
</div></div></div>
</blockquote></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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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_1553_21179500.1386259573828--
.
Author: Roman Perepelitsa <roman.perepelitsa@gmail.com>
Date: Thu, 5 Dec 2013 17:14:49 +0100
Raw View
--001a11c2500460393704eccbd525
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
2013/12/5 Vlad from Moscow <vlad.moscow@mail.ru>
> I did not know this. Could you point out corresponding sections of the C+=
+
> Standard that regulate this?
>
std::array<int, 3> can be initialized from {1, 2, 3}.
std::array<int, 3> a =3D {1, 2, 3};
std::array<int, 3> is assignable.
std::array<int, 3> a;
std::array<int, 3> b =3D {1, 2, 3};
a =3D b;
The last statement can be rewritten as:
a =3D std::array<int, 3>{1, 2, 3};
Or simply:
a =3D {1, 2, 3};
Under the hood it creates std::array<int, 3> from {1, 2, 3} and then
assigns one std::array to another.
Roman.
> =DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=C2=D2=D1 2013 =C7., 19:45:08 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Roman Perepelitsa
> =CE=C1=D0=C9=D3=C1=CC:
>
>> 2013/12/5 Vlad from Moscow <vlad....@mail.ru>
>>
>> If I am not mistaken aggregates may have user-defined assignment
>>> operators. I would propose to define assignment operator with parameter=
of
>>> type std::initializer_list for class std::array. It would make using of
>>> std:;array more popular.
>>> For example
>>>
>>> std:;array<int, 3> a;
>>>
>>> if ( today =3D=3D "Monday" ) a =3D { 1, 2, 3 };
>>> else if ( today =3D=3D "Tuesday" ) a =3D { 3, 2, 1 };
>>> else if ( today =3D=3D "Friday" ) a =3D { 0, 0, 0 };
>>>
>>
>> I believe this is valid C++11 code (modulo s/:;/::/ in the definition of
>> the array). If your compiler rejects it, try double curlies: a =3D {{1, =
2,
>> 3}}.
>>
>> Roman.
>>
> --
>
> ---
> 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/.
>
--=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/.
--001a11c2500460393704eccbd525
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">2013=
/12/5 Vlad from Moscow <span dir=3D"ltr"><<a href=3D"mailto:vlad.moscow@=
mail.ru" target=3D"_blank">vlad.moscow@mail.ru</a>></span><br><blockquot=
e class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width=
:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-lef=
t:1ex">
<div dir=3D"ltr"><div>I did not know this. Could you point out correspondin=
g sections of the C++ Standard that regulate this?</div></div></blockquote>=
<div><br></div><div>std::array<int, 3> can be initialized from {1, 2,=
3}.</div>
<div><br></div><div>=9A std::array<int, 3> a =3D {1, 2, 3};<br></div>=
<div><br></div><div>std::array<int, 3> is assignable.</div><div><br><=
/div><div>=9A std::array<int, 3> a;</div><div>=9A std::array<int, =
3> b =3D {1, 2, 3};</div>
<div>=9A a =3D b;</div><div><br></div><div>The last statement can be rewrit=
ten as:</div><div><br></div><div>=9A a =3D std::array<int, 3>{1, 2, 3=
};</div><div><br></div><div>Or simply:</div><div><br></div><div>=9A a =3D {=
1, 2, 3};</div>
<div><br></div><div>Under the hood it creates std::array<int, 3> from=
{1, 2, 3} and then assigns one std::array to another.</div><div><br></div>=
<div>Roman.</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"=
margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,20=
4,204);border-left-style:solid;padding-left:1ex">
<div dir=3D"ltr"><div>=9A</div><div>=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=
=C2=D2=D1 2013=9A=C7., 19:45:08 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 =
Roman Perepelitsa =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:r=
gb(204,204,204);border-left-width:1px;border-left-style:solid">
<div dir=3D"ltr"><div><div class=3D"gmail_quote">2013/12/5 Vlad from Moscow=
<span dir=3D"ltr"><<a>vlad....@mail.ru</a>></span><div><div class=3D=
"h5"><br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px=
;border-left-style:solid">
<div dir=3D"ltr"><div>If I am not mistaken aggregates may have user-defined=
assignment operators. I would propose to define assignment operator with p=
arameter of type std::initializer_list for class std::array. It would make =
using of std:;array more popular.</div>
<div>For example</div><div>=9A</div><div>std:;array<int, 3> a;</div><=
div>=9A</div><div>if ( today =3D=3D "Monday" ) a =3D { 1, 2, 3 };=
</div><div>else if ( today =3D=3D "Tuesday" ) a =3D { 3, 2, 1 };<=
/div><div>else if ( today =3D=3D "Friday" ) a =3D { 0, 0, 0 };</d=
iv>
</div></blockquote><div><br></div><div>I believe this is valid C++11 code (=
modulo s/:;/::/ in the definition of the array). If your compiler rejects i=
t, try double curlies: a =3D {{1, 2, 3}}.</div><div><br></div><div>Roman.</=
div>
</div></div></div></div></div>
</blockquote></div>
<p></p>
-- <br><div class=3D""><div class=3D"h5">
=9A<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%2Bunsubscribe@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>
</div></div></blockquote></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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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 />
--001a11c2500460393704eccbd525--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 5 Dec 2013 08:21:56 -0800 (PST)
Raw View
------=_Part_676_1797638.1386260516992
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
It is not clear for me why these statements
=20
a =3D std::array<int, 3>{1, 2, 3};
a =3D {1, 2, 3};
=20
are equivalent?
=20
=20
=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=C2=D2=D1 2013 =C7., 20:14:49 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Roman Perepelitsa=20
=CE=C1=D0=C9=D3=C1=CC:
> 2013/12/5 Vlad from Moscow <vlad....@mail.ru <javascript:>>
>
>> I did not know this. Could you point out corresponding sections of the=
=20
>> C++ Standard that regulate this?
>>
>
> std::array<int, 3> can be initialized from {1, 2, 3}.
>
> std::array<int, 3> a =3D {1, 2, 3};
>
> std::array<int, 3> is assignable.
>
> std::array<int, 3> a;
> std::array<int, 3> b =3D {1, 2, 3};
> a =3D b;
>
> The last statement can be rewritten as:
>
> a =3D std::array<int, 3>{1, 2, 3};
>
> Or simply:
>
> a =3D {1, 2, 3};
>
> Under the hood it creates std::array<int, 3> from {1, 2, 3} and then=20
> assigns one std::array to another.
>
> Roman.
>
> =20
>> =DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=C2=D2=D1 2013 =C7., 19:45:08 UTC+4=
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Roman Perepelitsa=20
>> =CE=C1=D0=C9=D3=C1=CC:
>>
>>> 2013/12/5 Vlad from Moscow <vlad....@mail.ru>
>>>
>>> If I am not mistaken aggregates may have user-defined assignment=20
>>>> operators. I would propose to define assignment operator with paramete=
r of=20
>>>> type std::initializer_list for class std::array. It would make using o=
f=20
>>>> std:;array more popular.
>>>> For example
>>>> =20
>>>> std:;array<int, 3> a;
>>>> =20
>>>> if ( today =3D=3D "Monday" ) a =3D { 1, 2, 3 };
>>>> else if ( today =3D=3D "Tuesday" ) a =3D { 3, 2, 1 };
>>>> else if ( today =3D=3D "Friday" ) a =3D { 0, 0, 0 };
>>>>
>>>
>>> I believe this is valid C++11 code (modulo s/:;/::/ in the definition o=
f=20
>>> the array). If your compiler rejects it, try double curlies: a =3D {{1,=
2,=20
>>> 3}}.
>>>
>>> Roman.
>>> =20
>> --=20
>> =20
>> ---=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 <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> Visit this group at=20
>> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>>
>
>
--=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_676_1797638.1386260516992
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>It is not clear for me why these statements</div><div=
> </div><div><div> a =3D std::array<int, 3>{1, 2, 3};</div=
><div> a =3D {1, 2, 3};</div><div> </div><div>are equivalent?</d=
iv><div> </div><div><br> </div><br>=DE=C5=D4=D7=C5=D2=C7, 5 =C4=
=C5=CB=C1=C2=D2=D1 2013 =C7., 20:14:49 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=
=D4=C5=CC=D8 Roman Perepelitsa =CE=C1=D0=C9=D3=C1=CC:</div><blockquote clas=
s=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; bo=
rder-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-st=
yle: solid;"><div dir=3D"ltr"><div><div class=3D"gmail_quote">2013/12/5 Vla=
d from Moscow <span dir=3D"ltr"><<a onmousedown=3D"this.href=3D'javascri=
pt:';return true;" onclick=3D"this.href=3D'javascript:';return true;" href=
=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"_QhSkJc9djkJ">v=
lad....@mail.ru</a>></span><br><blockquote class=3D"gmail_quote" style=
=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(20=
4, 204, 204); border-left-width: 1px; border-left-style: solid;">
<div dir=3D"ltr"><div>I did not know this. Could you point out correspondin=
g sections of the C++ Standard that regulate this?</div></div></blockquote>=
<div><br></div><div>std::array<int, 3> can be initialized from {1, 2,=
3}.</div>
<div><br></div><div> std::array<int, 3> a =3D {1, 2, 3};<br></d=
iv><div><br></div><div>std::array<int, 3> is assignable.</div><div><b=
r></div><div> std::array<int, 3> a;</div><div> std::array=
<int, 3> b =3D {1, 2, 3};</div>
<div> a =3D b;</div><div><br></div><div>The last statement can be rew=
ritten as:</div><div><br></div><div> a =3D std::array<int, 3>{1=
, 2, 3};</div><div><br></div><div>Or simply:</div><div><br></div><div> =
; a =3D {1, 2, 3};</div>
<div><br></div><div>Under the hood it creates std::array<int, 3> from=
{1, 2, 3} and then assigns one std::array to another.</div><div><br></div>=
<div>Roman.</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"=
margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 2=
04, 204); border-left-width: 1px; border-left-style: solid;">
<div dir=3D"ltr"><div> </div><div>=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=
=C1=C2=D2=D1 2013 =C7., 19:45:08 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=
=CC=D8 Roman Perepelitsa =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"g=
mail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-l=
eft-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: s=
olid;">
<div dir=3D"ltr"><div><div class=3D"gmail_quote">2013/12/5 Vlad from Moscow=
<span dir=3D"ltr"><<a>vlad....@mail.ru</a>></span><div><div><br><blo=
ckquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-l=
eft: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; bo=
rder-left-style: solid;">
<div dir=3D"ltr"><div>If I am not mistaken aggregates may have user-defined=
assignment operators. I would propose to define assignment operator with p=
arameter of type std::initializer_list for class std::array. It would make =
using of std:;array more popular.</div>
<div>For example</div><div> </div><div>std:;array<int, 3> a;</di=
v><div> </div><div>if ( today =3D=3D "Monday" ) a =3D { 1, 2, 3 };</di=
v><div>else if ( today =3D=3D "Tuesday" ) a =3D { 3, 2, 1 };</div><div>else=
if ( today =3D=3D "Friday" ) a =3D { 0, 0, 0 };</div>
</div></blockquote><div><br></div><div>I believe this is valid C++11 code (=
modulo s/:;/::/ in the definition of the array). If your compiler rejects i=
t, try double curlies: a =3D {{1, 2, 3}}.</div><div><br></div><div>Roman.</=
div>
</div></div></div></div></div>
</blockquote></div>
<p></p>
-- <br><div><div>
<br>
--- <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 onmousedown=3D"this.href=3D'javascript:';return true;" onclick=
=3D"this.href=3D'javascript:';return true;" href=3D"javascript:" target=3D"=
_blank" gdf-obfuscated-mailto=3D"_QhSkJc9djkJ">std-proposal...@<wbr>isocpp.=
org</a>.<br>
To post to this group, send email to <a onmousedown=3D"this.href=3D'javascr=
ipt:';return true;" onclick=3D"this.href=3D'javascript:';return true;" href=
=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"_QhSkJc9djkJ">s=
td-pr...@isocpp.org</a>.<br>
Visit this group at <a onmousedown=3D"this.href=3D'http://groups.google.com=
/a/isocpp.org/group/std-proposals/';return true;" onclick=3D"this.href=3D'h=
ttp://groups.google.com/a/isocpp.org/group/std-proposals/';return true;" hr=
ef=3D"http://groups.google.com/a/isocpp.org/group/std-proposals/" target=3D=
"_blank">http://groups.google.com/a/<wbr>isocpp.org/group/std-<wbr>proposal=
s/</a>.<br>
</div></div></blockquote></div><br></div></div>
</blockquote></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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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_676_1797638.1386260516992--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 5 Dec 2013 18:24:39 +0200
Raw View
On 5 December 2013 18:06, Vlad from Moscow <vlad.moscow@mail.ru> wrote:
> I did not know this. Could you point out corresponding sections of the C++
> Standard that regulate this?
That would be [class.copy]/28
Especially the second bullet,
" if the subobject is an array, each element is assigned, in the
manner appropriate to the element type;"
--
---
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: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 5 Dec 2013 18:29:14 +0200
Raw View
On 5 December 2013 18:21, Vlad from Moscow <vlad.moscow@mail.ru> wrote:
> It is not clear for me why these statements
>
> a = std::array<int, 3>{1, 2, 3};
> a = {1, 2, 3};
>
> are equivalent?
Because the right-hand-side of the latter assignment will attempt to
list-initialize
its function argument. The former assignment does so explicitly.
--
---
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: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 5 Dec 2013 08:42:39 -0800 (PST)
Raw View
------=_Part_2723_30631263.1386261759307
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
i did not think that aggregates behave as other classes. That is I thought=
=20
that they indeed perform memberwise copying but do not convert initializer=
=20
lists to objects of aggregate types.=20
Never theless I think it is not clear from the standard.=20
=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=C2=D2=D1 2013 =C7., 20:29:14 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Ville Voutilainen=20
=CE=C1=D0=C9=D3=C1=CC:
> On 5 December 2013 18:21, Vlad from Moscow <vlad....@mail.ru <javascript:=
>>=20
> wrote:=20
> > It is not clear for me why these statements=20
> >=20
> > a =3D std::array<int, 3>{1, 2, 3};=20
> > a =3D {1, 2, 3};=20
> >=20
> > are equivalent?=20
>
> Because the right-hand-side of the latter assignment will attempt to=20
> list-initialize=20
> its function argument. The former assignment does so explicitly.=20
>
--=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_2723_30631263.1386261759307
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>i did not think that aggregates behave as other =
classes. That is I thought that they indeed perform memberwise copying but =
do not convert initializer lists to objects of aggregate types. <=
/div><div>Never theless I think it is not clear from the standard. </d=
iv><div><br>=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=C2=D2=D1 2013 =C7., =
20:29:14 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Ville Voutilainen =CE=
=C1=D0=C9=D3=C1=CC:</div><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;">On 5 December 2013 18=
:21, Vlad from Moscow <<a onmousedown=3D"this.href=3D'javascript:';retur=
n true;" onclick=3D"this.href=3D'javascript:';return true;" href=3D"javascr=
ipt:" target=3D"_blank" gdf-obfuscated-mailto=3D"E0Alaqobts8J">vlad....@mai=
l.ru</a>> wrote:
<br>> It is not clear for me why these statements
<br>>
<br>> a =3D std::array<int, 3>{1, 2, 3};
<br>> a =3D {1, 2, 3};
<br>>
<br>> are equivalent?
<br>
<br>Because the right-hand-side of the latter assignment will attempt to
<br>list-initialize
<br>its function argument. The former assignment does so explicitly.
<br></blockquote></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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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_2723_30631263.1386261759307--
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 5 Dec 2013 08:46:27 -0800 (PST)
Raw View
------=_Part_348_6785483.1386261987969
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
=20
Even it is not clear whether this statement is correct
=20
a =3D std::array<int, 3>{1, 2, 3};=20
=20
because there is no declaration of an object of type std::array.
=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=C2=D2=D1 2013 =C7., 20:42:39 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
=CE=C1=D0=C9=D3=C1=CC:
> i did not think that aggregates behave as other classes. That is I though=
t=20
> that they indeed perform memberwise copying but do not convert initialize=
r=20
> lists to objects of aggregate types.=20
> Never theless I think it is not clear from the standard.=20
>
> =DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=C2=D2=D1 2013 =C7., 20:29:14 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Ville Voutilainen=20
> =CE=C1=D0=C9=D3=C1=CC:
>
>> On 5 December 2013 18:21, Vlad from Moscow <vlad....@mail.ru> wrote:=20
>> > It is not clear for me why these statements=20
>> >=20
>> > a =3D std::array<int, 3>{1, 2, 3};=20
>> > a =3D {1, 2, 3};=20
>> >=20
>> > are equivalent?=20
>>
>> Because the right-hand-side of the latter assignment will attempt to=20
>> list-initialize=20
>> its function argument. The former assignment does so explicitly.=20
>>
>
--=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_348_6785483.1386261987969
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div> </div><div>Even it is not clear whether th=
is statement is correct</div><div> </div><div>a =3D std::array<int,=
3>{1, 2, 3}; </div><div> </div><div>because there is no declaratio=
n of an object of type std::array.<br></div><div><br>=DE=C5=D4=D7=C5=D2=C7,=
5 =C4=C5=CB=C1=C2=D2=D1 2013 =C7., 20:42:39 UTC+4 =D0=CF=CC=D8=DA=CF=
=D7=C1=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote=
class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1e=
x; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-le=
ft-style: solid;"><div dir=3D"ltr"><div>i did not think that aggregate=
s behave as other classes. That is I thought that they indeed perform membe=
rwise copying but do not convert initializer lists to objects of =
aggregate types. </div><div>Never theless I think it is not clear from the =
standard. </div><div><br>=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=C2=D2=
=D1 2013 =C7., 20:29:14 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vil=
le Voutilainen =CE=C1=D0=C9=D3=C1=CC:</div><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;">On =
5 December 2013 18:21, Vlad from Moscow <<a>vlad....@mail.ru</a>> wro=
te:
<br>> It is not clear for me why these statements
<br>>
<br>> a =3D std::array<int, 3>{1, 2, 3};
<br>> a =3D {1, 2, 3};
<br>>
<br>> are equivalent?
<br>
<br>Because the right-hand-side of the latter assignment will attempt to
<br>list-initialize
<br>its function argument. The former assignment does so explicitly.
<br></blockquote></div></blockquote></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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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_348_6785483.1386261987969--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 5 Dec 2013 18:56:17 +0200
Raw View
On 5 December 2013 18:42, Vlad from Moscow <vlad.moscow@mail.ru> wrote:
> i did not think that aggregates behave as other classes. That is I thought
> that they indeed perform memberwise copying but do not convert initializer
> lists to objects of aggregate types.
> Never theless I think it is not clear from the standard.
It seems that implementations very much disagree it not being clear. And even
further, there's [dcl.init.aggr]/2,11.
--
---
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: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 5 Dec 2013 19:03:05 +0200
Raw View
On 5 December 2013 18:46, Vlad from Moscow <vlad.moscow@mail.ru> wrote:
>
> Even it is not clear whether this statement is correct
>
> a = std::array<int, 3>{1, 2, 3};
>
> because there is no declaration of an object of type std::array.
I shouldn't respond to such nonsense, but Roman's example declared a as
an array, and there's a relatively visible array temporary in that snippet. So
I don't have the faintest clue what you're talking about here.
--
---
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: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 5 Dec 2013 09:10:22 -0800 (PST)
Raw View
------=_Part_2630_6028857.1386263422296
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
There is difference between declarations and expressions. For example I=20
understanf this declaration
=20
int a[] =3D { 1, 2, 3 };
=20
But I do not understand this expression
=20
int [] { 1, 2, 3 };
=20
From my point of view the same difference exists and for aggregate classes.=
=20
At least I did not found in the section decribing aggregates where it is=20
allowed. In this section there is written about initializations during=20
declarations.
=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=C2=D2=D1 2013 =C7., 21:03:05 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Ville Voutilainen=20
=CE=C1=D0=C9=D3=C1=CC:
> On 5 December 2013 18:46, Vlad from Moscow <vlad....@mail.ru <javascript:=
>>=20
> wrote:=20
> >=20
> > Even it is not clear whether this statement is correct=20
> >=20
> > a =3D std::array<int, 3>{1, 2, 3};=20
> >=20
> > because there is no declaration of an object of type std::array.=20
>
> I shouldn't respond to such nonsense, but Roman's example declared a as=
=20
> an array, and there's a relatively visible array temporary in that=20
> snippet. So=20
> I don't have the faintest clue what you're talking about here.=20
>
--=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_2630_6028857.1386263422296
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>There is difference between declarations and expressi=
ons. For example I understanf this declaration</div><div> </div><div>i=
nt a[] =3D { 1, 2, 3 };</div><div> </div><div>But I do not understand =
this expression</div><div> </div><div>int [] { 1, 2, 3 };</div><div>&n=
bsp;</div><div>From my point of view the same difference exists and for agg=
regate classes. At least I did not found in the section decribing aggregate=
s where it is allowed. In this section there is written about initializatio=
ns during declarations.</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=
=C2=D2=D1 2013 =C7., 21:03:05 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=
=D8 Ville Voutilainen =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmai=
l_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: soli=
d;">On 5 December 2013 18:46, Vlad from Moscow <<a onmousedown=3D"this.h=
ref=3D'javascript:';return true;" onclick=3D"this.href=3D'javascript:';retu=
rn true;" href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"a=
IE1dSjKfJoJ">vlad....@mail.ru</a>> wrote:
<br>>
<br>> Even it is not clear whether this statement is correct
<br>>
<br>> a =3D std::array<int, 3>{1, 2, 3};
<br>>
<br>> because there is no declaration of an object of type std::array.
<br>
<br>I shouldn't respond to such nonsense, but Roman's example declared a as
<br>an array, and there's a relatively visible array temporary in that snip=
pet. So
<br>I don't have the faintest clue what you're talking about here.
<br></blockquote></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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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_2630_6028857.1386263422296--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 5 Dec 2013 19:32:09 +0200
Raw View
On 5 December 2013 19:10, Vlad from Moscow <vlad.moscow@mail.ru> wrote:
> There is difference between declarations and expressions. For example I
> understanf this declaration
>
> int a[] = { 1, 2, 3 };
>
> But I do not understand this expression
>
> int [] { 1, 2, 3 };
>
> From my point of view the same difference exists and for aggregate classes.
> At least I did not found in the section decribing aggregates where it is
> allowed. In this section there is written about initializations during
> declarations.
The difference is that [expr.type.conv] will not work for built-in array types.
--
---
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: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 5 Dec 2013 09:40:00 -0800 (PST)
Raw View
------=_Part_1638_10435995.1386265200141
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
Well, I thought that the same is valid for aggregate classes. There is no=
=20
conversion constriuctor for aggregate classes that converts initializer=20
list to an object of the aggregate type.So it is not clear and I can not=20
find where it is said that it is allowed. At least in section=20
[dcl.init.aggr] there is said nothing about this.=20
=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=C2=D2=D1 2013 =C7., 21:32:09 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Ville Voutilainen=20
=CE=C1=D0=C9=D3=C1=CC:
> On 5 December 2013 19:10, Vlad from Moscow <vlad....@mail.ru <javascript:=
>>=20
> wrote:=20
> > There is difference between declarations and expressions. For example I=
=20
> > understanf this declaration=20
> >=20
> > int a[] =3D { 1, 2, 3 };=20
> >=20
> > But I do not understand this expression=20
> >=20
> > int [] { 1, 2, 3 };=20
> >=20
> > From my point of view the same difference exists and for aggregate=20
> classes.=20
> > At least I did not found in the section decribing aggregates where it i=
s=20
> > allowed. In this section there is written about initializations during=
=20
> > declarations.=20
>
> The difference is that [expr.type.conv] will not work for built-in array=
=20
> types.=20
>
--=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_1638_10435995.1386265200141
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Well, I thought that the same is valid for aggregate =
classes. There is no conversion constriuctor for aggregate classes that con=
verts initializer list to an object of the aggregate type.So it is not clea=
r and I can not find where it is said that it is allowed. At least in =
section [dcl.init.aggr] there is said nothing about this. </div><div><br>=
=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=C2=D2=D1 2013 =C7., 21:32:09 UTC=
+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Ville Voutilainen =CE=C1=D0=C9=D3=
=C1=CC:</div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px=
0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-le=
ft-width: 1px; border-left-style: solid;">On 5 December 2013 19:10, Vlad fr=
om Moscow <<a onmousedown=3D"this.href=3D'javascript:';return true;" onc=
lick=3D"this.href=3D'javascript:';return true;" href=3D"javascript:" target=
=3D"_blank" gdf-obfuscated-mailto=3D"ucEC6euR14MJ">vlad....@mail.ru</a>>=
wrote:
<br>> There is difference between declarations and expressions. For exam=
ple I
<br>> understanf this declaration
<br>>
<br>> int a[] =3D { 1, 2, 3 };
<br>>
<br>> But I do not understand this expression
<br>>
<br>> int [] { 1, 2, 3 };
<br>>
<br>> From my point of view the same difference exists and for aggregate=
classes.
<br>> At least I did not found in the section decribing aggregates where=
it is
<br>> allowed. In this section there is written about initializations du=
ring
<br>> declarations.
<br>
<br>The difference is that [expr.type.conv] will not work for built-i=
n array types.
<br></blockquote></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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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_1638_10435995.1386265200141--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 5 Dec 2013 20:03:18 +0200
Raw View
On 5 December 2013 19:40, Vlad from Moscow <vlad.moscow@mail.ru> wrote:
> Well, I thought that the same is valid for aggregate classes. There is no
> conversion constriuctor for aggregate classes that converts initializer list
> to an object of the aggregate type.So it is not clear and I can not find
> where it is said that it is allowed. At least in section [dcl.init.aggr]
> there is said nothing about this.
As I already said, paragraphs 2 and 11 specify 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/.
.
Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 5 Dec 2013 10:19:09 -0800 (PST)
Raw View
------=_Part_685_137337.1386267549822
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
=20
If you mean paragraphs 2 and 11 of section [dcl.init.aggr] then there is=20
nothing said that such conversion of expressions is possible.
=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=C2=D2=D1 2013 =C7., 22:03:18 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Ville Voutilainen=20
=CE=C1=D0=C9=D3=C1=CC:
> On 5 December 2013 19:40, Vlad from Moscow <vlad....@mail.ru <javascript:=
>>=20
> wrote:=20
> > Well, I thought that the same is valid for aggregate classes. There is=
=20
> no=20
> > conversion constriuctor for aggregate classes that converts initializer=
=20
> list=20
> > to an object of the aggregate type.So it is not clear and I can not fin=
d=20
> > where it is said that it is allowed. At least in section [dcl.init.aggr=
]=20
> > there is said nothing about this.=20
>
>
> As I already said, paragraphs 2 and 11 specify it.=20
>
--=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_685_137337.1386267549822
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div> </div><div>If you mean paragraphs 2 and 11 of s=
ection [dcl.init.aggr] then there is nothing said that such conversion of e=
xpressions is possible.</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 5 =C4=C5=CB=C1=
=C2=D2=D1 2013 =C7., 22:03:18 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=
=D8 Ville Voutilainen =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmai=
l_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: soli=
d;">On 5 December 2013 19:40, Vlad from Moscow <<a onmousedown=3D"this.h=
ref=3D'javascript:';return true;" onclick=3D"this.href=3D'javascript:';retu=
rn true;" href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"-=
0eIQyvn62MJ">vlad....@mail.ru</a>> wrote:
<br>> Well, I thought that the same is valid for aggregate classes. Ther=
e is no
<br>> conversion constriuctor for aggregate classes that converts initia=
lizer list
<br>> to an object of the aggregate type.So it is not clear and I can no=
t find
<br>> where it is said that it is allowed. At least in section [dcl.init=
..aggr]
<br>> there is said nothing about this.
<br>
<br>
<br>As I already said, paragraphs 2 and 11 specify it.
<br></blockquote></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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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_685_137337.1386267549822--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 5 Dec 2013 21:02:16 +0200
Raw View
On 5 December 2013 20:19, Vlad from Moscow <vlad.moscow@mail.ru> wrote:
>
> If you mean paragraphs 2 and 11 of section [dcl.init.aggr] then there is
> nothing said that such conversion of expressions is possible.
Except that [dcl.init]/1 says
"The process of initialization described in the remainder of 8.5
applies also to initializa-
tions specified by other syntactic contexts, such as the
initialization of function parameters with argument
expressions (5.2.2) or the initialization of return values (6.6.3)."
so it's not at all limited to declarations.
If you're trying to find an actual defect, look elsewhere.
--
---
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/.
.