Topic: Initializer list for move-only types


Author: m.cencora@gmail.com
Date: Wed, 26 Oct 2016 06:35:25 -0700 (PDT)
Raw View
------=_Part_2104_556885896.1477488925721
Content-Type: multipart/alternative;
 boundary="----=_Part_2105_1204335180.1477488925721"

------=_Part_2105_1204335180.1477488925721
Content-Type: text/plain; charset=UTF-8

Hi,

in C++14 we can construct std::array with a list of move-only objects
(non-copyable) thanks to aggregate initialization.
Unfortunately we cannot do the same for std::vector of move-only types,
because initializer list points to const objects.
While language experts know the reason of it, from pure user perspective it
is inconsistent.

#include <iterator>
#include <vector>
#include <array>

struct MoveOnly
{
   MoveOnly(MoveOnly&&) = default;
   MoveOnly& operator=(MoveOnly&&) = default;
};

int main()
{
   // works just fine
   std::array<MoveOnly, 4> arr = {{
      MoveOnly{},
      MoveOnly{},
      MoveOnly{},
      MoveOnly{}
   }};

   // does not compile
   std::vector<MoveOnly> vec = {
      MoveOnly{},
      MoveOnly{},
      MoveOnly{},
      MoveOnly{}
   };

  // workaround
  std::vector<MoveOnly> vec2(std::make_move_iterator(arr.begin()),
                             std::make_move_iterator(arr.end()));
}



Can this be fixed?

Regards,
Maciej

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/34f09dd5-e231-4a0b-a218-48c8eabe73c5%40isocpp.org.

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

<div dir=3D"ltr">Hi,<div><br></div><div>in C++14 we can construct std::arra=
y with a list of move-only objects (non-copyable) thanks to aggregate initi=
alization.</div><div>Unfortunately we cannot do the same for std::vector of=
 move-only types, because initializer list points to const objects.</div><d=
iv>While language experts know the reason of it, from pure user perspective=
 it is inconsistent.</div><div><br></div><div><div class=3D"prettyprint" st=
yle=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-word; backgro=
und-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><div class=3D"s=
ubprettyprint"><div class=3D"subprettyprint"><font color=3D"#660066">#inclu=
de &lt;iterator&gt;<br>#include &lt;vector&gt;</font></div><div class=3D"su=
bprettyprint"><font color=3D"#660066">#include &lt;array&gt;</font></div><d=
iv class=3D"subprettyprint"><font color=3D"#660066"><br></font></div><div c=
lass=3D"subprettyprint"><font color=3D"#660066">struct MoveOnly</font></div=
><div class=3D"subprettyprint"><font color=3D"#660066">{</font></div><div c=
lass=3D"subprettyprint"><font color=3D"#660066">=C2=A0 =C2=A0MoveOnly(MoveO=
nly&amp;&amp;) =3D default;</font></div><div class=3D"subprettyprint"><font=
 color=3D"#660066">=C2=A0 =C2=A0MoveOnly&amp; operator=3D(MoveOnly&amp;&amp=
;) =3D default;</font></div><div class=3D"subprettyprint"><font color=3D"#6=
60066">};</font></div><div class=3D"subprettyprint"><font color=3D"#660066"=
><br></font></div><div class=3D"subprettyprint"><font color=3D"#660066">int=
 main()</font></div><div class=3D"subprettyprint"><font color=3D"#660066">{=
<br>=C2=A0 =C2=A0// works just fine</font></div><div class=3D"subprettyprin=
t"><font color=3D"#660066">=C2=A0 =C2=A0std::array&lt;MoveOnly, 4&gt; arr =
=3D {{</font></div><div class=3D"subprettyprint"><font color=3D"#660066">=
=C2=A0 =C2=A0 =C2=A0 MoveOnly{},</font></div><div class=3D"subprettyprint">=
<font color=3D"#660066">=C2=A0 =C2=A0 =C2=A0 MoveOnly{},</font></div><div c=
lass=3D"subprettyprint"><font color=3D"#660066">=C2=A0 =C2=A0 =C2=A0 MoveOn=
ly{},</font></div><div class=3D"subprettyprint"><font color=3D"#660066">=C2=
=A0 =C2=A0 =C2=A0 MoveOnly{}</font></div><div class=3D"subprettyprint"><fon=
t color=3D"#660066">=C2=A0 =C2=A0}};</font></div><div class=3D"subprettypri=
nt"><font color=3D"#660066"><br>=C2=A0 =C2=A0// does not compile</font></di=
v><div class=3D"subprettyprint"><font color=3D"#660066">=C2=A0 =C2=A0std::v=
ector&lt;MoveOnly&gt; vec =3D {</font></div><div class=3D"subprettyprint"><=
font color=3D"#660066">=C2=A0 =C2=A0 =C2=A0 MoveOnly{},</font></div><div cl=
ass=3D"subprettyprint"><font color=3D"#660066">=C2=A0 =C2=A0 =C2=A0 MoveOnl=
y{},</font></div><div class=3D"subprettyprint"><font color=3D"#660066">=C2=
=A0 =C2=A0 =C2=A0 MoveOnly{},</font></div><div class=3D"subprettyprint"><fo=
nt color=3D"#660066">=C2=A0 =C2=A0 =C2=A0 MoveOnly{}</font></div><div class=
=3D"subprettyprint"><font color=3D"#660066">=C2=A0 =C2=A0};<br><br>=C2=A0 /=
/ workaround<br><div class=3D"subprettyprint">=C2=A0 std::vector&lt;MoveOnl=
y&gt; vec2(std::make_move_iterator(arr.begin()),</div><div class=3D"subpret=
typrint">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0std::make_move_iterator(arr.end()));<=
/div></font></div><div class=3D"subprettyprint"><font color=3D"#660066">}</=
font></div><div><br></div></div></code></div><br><br></div><div>Can this be=
 fixed?</div><div><br></div><div>Regards,</div><div>Maciej</div></div>

<p></p>

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

------=_Part_2105_1204335180.1477488925721--

------=_Part_2104_556885896.1477488925721--

.


Author: "D. B." <db0451@gmail.com>
Date: Wed, 26 Oct 2016 14:38:37 +0100
Raw View
--001a113677f40cd421053fc4bec5
Content-Type: text/plain; charset=UTF-8

www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0065r0.pdf

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CACGiwhFZMkmBHsfhOZXzthKhw8%2BkGkiiwGNu%2BLtXCOWHP5DOFA%40mail.gmail.com.

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

<div dir=3D"ltr"><cite class=3D"gmail-_Rm"><a href=3D"http://www.open-std.o=
rg/jtc1/sc22/wg21/docs/papers/2015/p0065r0.pdf">www.open-std.org/jtc1/sc22/=
wg21/docs/papers/2015/p0065r0.pdf</a></cite></div>

<p></p>

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

--001a113677f40cd421053fc4bec5--

.


Author: m.cencora@gmail.com
Date: Wed, 26 Oct 2016 06:46:45 -0700 (PDT)
Raw View
------=_Part_2174_1794951286.1477489605548
Content-Type: multipart/alternative;
 boundary="----=_Part_2175_922310137.1477489605548"

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

Nice, is this targeted for C++17?

W dniu =C5=9Broda, 26 pa=C5=BAdziernika 2016 15:38:40 UTC+2 u=C5=BCytkownik=
 D. B. napisa=C5=82:
>
> www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0065r0.pdf
>

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/6030c88d-626c-4cf9-a0e6-963ae3fbe708%40isocpp.or=
g.

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

<div dir=3D"ltr">Nice, is this targeted for C++17?<br><br>W dniu =C5=9Broda=
, 26 pa=C5=BAdziernika 2016 15:38:40 UTC+2 u=C5=BCytkownik D. B. napisa=C5=
=82:<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"><cite><a =
href=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0065r0.pdf=
" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http:/=
/www.google.com/url?q\x3dhttp%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fsc22%2Fwg21=
%2Fdocs%2Fpapers%2F2015%2Fp0065r0.pdf\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQ=
jCNEA2ZrBV0Ss1Hraf2cURi_6UzXmYw&#39;;return true;" onclick=3D"this.href=3D&=
#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fs=
c22%2Fwg21%2Fdocs%2Fpapers%2F2015%2Fp0065r0.pdf\x26sa\x3dD\x26sntz\x3d1\x26=
usg\x3dAFQjCNEA2ZrBV0Ss1Hraf2cURi_6UzXmYw&#39;;return true;">www.open-std.o=
rg/jtc1/sc22/<wbr>wg21/docs/papers/2015/p0065r0.<wbr>pdf</a></cite></div>
</blockquote></div>

<p></p>

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

------=_Part_2175_922310137.1477489605548--

------=_Part_2174_1794951286.1477489605548--

.


Author: "D. B." <db0451@gmail.com>
Date: Wed, 26 Oct 2016 14:53:18 +0100
Raw View
--047d7bd91ac08df9fb053fc4f2dd
Content-Type: text/plain; charset=UTF-8

I don't think so, as I'd also like this but haven't seen any indications
that it's coming soon.
But you should check in the right places, e.g. the Papers and Issues Lists:
http://www.open-std.org/jtc1/sc22/wg21/docs/

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CACGiwhG3G0MTpVVnHosBae1%2B0KfdFSE2cTjZqf3H6xbE1Qe%2BTQ%40mail.gmail.com.

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

<div dir=3D"ltr">I don&#39;t think so, as I&#39;d also like this but haven&=
#39;t seen any indications that it&#39;s coming soon.<br>But you should che=
ck in the right places, e.g. the Papers and Issues Lists: <a href=3D"http:/=
/www.open-std.org/jtc1/sc22/wg21/docs/">http://www.open-std.org/jtc1/sc22/w=
g21/docs/</a><br><br></div>

<p></p>

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

--047d7bd91ac08df9fb053fc4f2dd--

.


Author: Nicol Bolas <jmckesson@gmail.com>
Date: Wed, 26 Oct 2016 06:54:24 -0700 (PDT)
Raw View
------=_Part_2302_919136602.1477490065172
Content-Type: multipart/alternative;
 boundary="----=_Part_2303_1481573759.1477490065172"

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

On Wednesday, October 26, 2016 at 9:46:45 AM UTC-4, m.ce...@gmail.com wrote=
:
>
> Nice, is this targeted for C++17?
>

If you're asking if it was adopted into C++17, no. From this Kona trip=20
report=20
<https://botondballo.wordpress.com/2015/11/09/trip-report-c-standards-meeti=
ng-in-kona-october-2015/>
:

> EWG didn=E2=80=99t find anything objectionable about this *per se*, but d=
idn=E2=80=99t=20
feel it was sufficiently motivated, and encouraged the author to return=20
with more compelling motivating examples.

The author never wrote another version of the paper.

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/ebe45369-2d16-4e75-802a-ea0a930aff73%40isocpp.or=
g.

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

<div dir=3D"ltr">On Wednesday, October 26, 2016 at 9:46:45 AM UTC-4, m.ce..=
..@gmail.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"=
ltr">Nice, is this targeted for C++17?<br></div></blockquote><div><br>If yo=
u&#39;re asking if it was adopted into C++17, no. From <a href=3D"https://b=
otondballo.wordpress.com/2015/11/09/trip-report-c-standards-meeting-in-kona=
-october-2015/">this Kona trip report</a>:<br><br>&gt; EWG didn=E2=80=99t f=
ind anything objectionable about this <em>per se</em>, but didn=E2=80=99t f=
eel it was sufficiently motivated, and encouraged the author to return with=
 more compelling motivating examples.<br><br>The author never wrote another=
 version of the paper.</div></div>

<p></p>

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

------=_Part_2303_1481573759.1477490065172--

------=_Part_2302_919136602.1477490065172--

.


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Wed, 26 Oct 2016 17:04:27 +0300
Raw View
On 26 October 2016 at 16:54, Nicol Bolas <jmckesson@gmail.com> wrote:
>> EWG didn=E2=80=99t find anything objectionable about this per se, but di=
dn=E2=80=99t feel
>> it was sufficiently motivated, and encouraged the author to return with =
more
>> compelling motivating examples.
>
> The author never wrote another version of the paper.


Interesting trip report, but the objection is that it changes the
meaning of existing cases. It's possible
that a proposal for a movable_initializer_list that is used only if
the traditional one can't would fare
better, but the author didn't agree to such an approach.

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAFk2RUaVN2W9BvfzF8b4LwPOthTrz47bvqNkE8QzY7biGBf=
Fxg%40mail.gmail.com.

.


Author: David Krauss <potswa@gmail.com>
Date: Thu, 27 Oct 2016 10:21:17 +0800
Raw View
--Apple-Mail=_B68F19EB-4591-442C-BBC7-104F0528A7F0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2016=E2=80=9310=E2=80=9326, at 10:04 PM, Ville Voutilainen <ville.vout=
ilainen@gmail.com> wrote:
>=20
> Interesting trip report, but the objection is that it changes the
> meaning of existing cases. It's possible
> that a proposal for a movable_initializer_list that is used only if
> the traditional one can't would fare
> better,

Are you referring to deduction of local variables, e.g. auto list =3D { "fo=
o"s, "bar"s, "baz"s } or for ( auto && str : { "foo"s, "bar"s, "baz"s } )?

Or something to do with overloading, e.g. std::vector< std::string > list {=
 "foo"s, "bar"s, "baz"s }?

> but the author didn't agree to such an approach.


??

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/BAC1B984-1709-4DC9-9A65-DF3DBDB1036E%40gmail.com=
..

--Apple-Mail=_B68F19EB-4591-442C-BBC7-104F0528A7F0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2016=E2=80=9310=
=E2=80=9326, at 10:04 PM, Ville Voutilainen &lt;<a href=3D"mailto:ville.vou=
tilainen@gmail.com" class=3D"">ville.voutilainen@gmail.com</a>&gt; wrote:</=
div><br class=3D"Apple-interchange-newline"><div class=3D""><div class=3D""=
>Interesting trip report, but the objection is that it changes the<br class=
=3D"">meaning of existing cases. It's possible<br class=3D"">that a proposa=
l for a movable_initializer_list that is used only if<br class=3D"">the tra=
ditional one can't would fare<br class=3D"">better,</div></div></blockquote=
><div><br class=3D""></div><div class=3D"">Are you referring to deduction o=
f local variables, e.g.&nbsp;<font face=3D"Courier" class=3D"">auto list =
=3D {&nbsp;"foo"s,&nbsp;</font><span style=3D"font-family: Courier;" class=
=3D"">"bar"s</span><font face=3D"Courier" class=3D"">,&nbsp;"baz"s&nbsp;}</=
font>&nbsp;or&nbsp;<font face=3D"Courier" class=3D"">for ( auto &amp;&amp; =
str :&nbsp;{&nbsp;"foo"s,&nbsp;"bar"s,&nbsp;"baz"s&nbsp;}&nbsp;)</font>?</d=
iv><div class=3D""><br class=3D""></div><div class=3D"">Or something to do =
with overloading, e.g. <font face=3D"Courier" class=3D"">std::vector&lt; st=
d::string &gt; list {&nbsp;"foo"s,&nbsp;"bar"s,&nbsp;"baz"s&nbsp;}</font>?<=
/div><div class=3D""><br class=3D""></div><blockquote type=3D"cite" class=
=3D""><div class=3D""><div class=3D"">but the author didn't agree to such a=
n approach.<br class=3D""></div></div></blockquote></div><div class=3D""><b=
r class=3D""></div><div class=3D"">??</div><div class=3D""><div class=3D"">=
<br class=3D""></div></div></body></html>

<p></p>

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

--Apple-Mail=_B68F19EB-4591-442C-BBC7-104F0528A7F0--

.


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 27 Oct 2016 09:27:13 +0300
Raw View
On 27 October 2016 at 05:21, David Krauss <potswa@gmail.com> wrote:
> Interesting trip report, but the objection is that it changes the
> meaning of existing cases. It's possible
> that a proposal for a movable_initializer_list that is used only if
> the traditional one can't would fare
> better,
>
>
> Are you referring to deduction of local variables, e.g. auto list = {
> "foo"s, "bar"s, "baz"s } or for ( auto && str : { "foo"s, "bar"s, "baz"s }
> )?
>
> Or something to do with overloading, e.g. std::vector< std::string > list {
> "foo"s, "bar"s, "baz"s }?


Neither. I'm referring to filling the functionality gap without
changing the meaning
of existing code, so that

vector<unique_ptr<int>> vec{make_unique<int>(42), make_unique<int>(666)};

works but there's no change to any currently valid cases.

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAFk2RUaHCWTJ7U_X2g09RwfCx9R02YjbSH%3DKTVNowUQE1mHuJQ%40mail.gmail.com.

.


Author: "'Johannes Schaub' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Thu, 27 Oct 2016 09:07:44 +0200
Raw View
--001a1143d52002d3ca053fd3660a
Content-Type: text/plain; charset=UTF-8

Am 27.10.2016 08:27 schrieb "Ville Voutilainen" <ville.voutilainen@gmail.com
>:
>
> On 27 October 2016 at 05:21, David Krauss <potswa@gmail.com> wrote:
> > Interesting trip report, but the objection is that it changes the
> > meaning of existing cases. It's possible
> > that a proposal for a movable_initializer_list that is used only if
> > the traditional one can't would fare
> > better,
> >
> >
> > Are you referring to deduction of local variables, e.g. auto list = {
> > "foo"s, "bar"s, "baz"s } or for ( auto && str : { "foo"s, "bar"s,
"baz"s }
> > )?
> >
> > Or something to do with overloading, e.g. std::vector< std::string >
list {
> > "foo"s, "bar"s, "baz"s }?
>
>
> Neither. I'm referring to filling the functionality gap without
> changing the meaning
> of existing code, so that
>
> vector<unique_ptr<int>> vec{make_unique<int>(42), make_unique<int>(666)};
>
> works but there's no change to any currently valid cases.
>

I don't see the utility of changing the meaning of deduction yet. I think
in the deducing cases, we could stay with const shallow initializer list
(if only for backward compatibility).

However outside of those two examples, what are cases that change meaning,
and what were the cases that caused evolution to reject the paper? It
appears to me that even David himself doesn't know about them yet (?)

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CANu6V4UtYph6qt0_251PaUjAHV4Py5TjeCXvL8qMix4zaYq8hw%40mail.gmail.com.

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

<p dir=3D"ltr"></p>
<p dir=3D"ltr">Am 27.10.2016 08:27 schrieb &quot;Ville Voutilainen&quot; &l=
t;<a href=3D"mailto:ville.voutilainen@gmail.com">ville.voutilainen@gmail.co=
m</a>&gt;:<br>
&gt;<br>
&gt; On 27 October 2016 at 05:21, David Krauss &lt;<a href=3D"mailto:potswa=
@gmail.com">potswa@gmail.com</a>&gt; wrote:<br>
&gt; &gt; Interesting trip report, but the objection is that it changes the=
<br>
&gt; &gt; meaning of existing cases. It&#39;s possible<br>
&gt; &gt; that a proposal for a movable_initializer_list that is used only =
if<br>
&gt; &gt; the traditional one can&#39;t would fare<br>
&gt; &gt; better,<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Are you referring to deduction of local variables, e.g. auto list=
 =3D {<br>
&gt; &gt; &quot;foo&quot;s, &quot;bar&quot;s, &quot;baz&quot;s } or for ( a=
uto &amp;&amp; str : { &quot;foo&quot;s, &quot;bar&quot;s, &quot;baz&quot;s=
 }<br>
&gt; &gt; )?<br>
&gt; &gt;<br>
&gt; &gt; Or something to do with overloading, e.g. std::vector&lt; std::st=
ring &gt; list {<br>
&gt; &gt; &quot;foo&quot;s, &quot;bar&quot;s, &quot;baz&quot;s }?<br>
&gt;<br>
&gt;<br>
&gt; Neither. I&#39;m referring to filling the functionality gap without<br=
>
&gt; changing the meaning<br>
&gt; of existing code, so that<br>
&gt;<br>
&gt; vector&lt;unique_ptr&lt;int&gt;&gt; vec{make_unique&lt;int&gt;(42), ma=
ke_unique&lt;int&gt;(666)};<br>
&gt;<br>
&gt; works but there&#39;s no change to any currently valid cases.<br>
&gt;<br></p>
<p dir=3D"ltr">I don&#39;t see the utility of changing the meaning of deduc=
tion yet. I think in the deducing cases, we could stay with const shallow i=
nitializer list (if only for backward compatibility).</p>
<p dir=3D"ltr">However outside of those two examples, what are cases that c=
hange meaning, and what were the cases that caused evolution to reject the =
paper? It appears to me that even David himself doesn&#39;t know about them=
 yet (?)<br>
</p>

<p></p>

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

--001a1143d52002d3ca053fd3660a--

.


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 27 Oct 2016 10:16:05 +0300
Raw View
On 27 October 2016 at 10:07, 'Johannes Schaub' via ISO C++ Standard -
Future Proposals <std-proposals@isocpp.org> wrote:
>> Neither. I'm referring to filling the functionality gap without
>> changing the meaning
>> of existing code, so that
>>
>> vector<unique_ptr<int>> vec{make_unique<int>(42), make_unique<int>(666)};
>>
>> works but there's no change to any currently valid cases.
>>
>
> I don't see the utility of changing the meaning of deduction yet. I think in
> the deducing cases, we could stay with const shallow initializer list (if
> only for backward compatibility).
>
> However outside of those two examples, what are cases that change meaning,
> and what were the cases that caused evolution to reject the paper? It
> appears to me that even David himself doesn't know about them yet (?)

I don't necessarily know of cases outside those two examples, because those
two examples are what changes meaning. The paper provides a similar example,

auto ls = { std::string( "hello" ) }; // ls has type
std::own_initializer_list< std::string >

and also

std::vector< std::string > vs = { "yizzo" }; // OK: move from sequence

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAFk2RUZ10e%2B3_PG%2ByiHrOj1NxuC4W_sd5ia5tR2H43cJtA5hxQ%40mail.gmail.com.

.


Author: David Krauss <potswa@gmail.com>
Date: Fri, 28 Oct 2016 08:14:41 +0800
Raw View
--Apple-Mail=_F6124A75-E701-4889-B14A-19BC37C5D640
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2016=E2=80=9310=E2=80=9327, at 3:16 PM, Ville Voutilainen <ville.vouti=
lainen@gmail.com> wrote:
>=20
> I don't necessarily know of cases outside those two examples, because tho=
se
> two examples are what changes meaning. The paper provides a similar examp=
le,
>=20
> auto ls =3D { std::string( "hello" ) }; // ls has type
> std::own_initializer_list< std::string >

This is the controversial case. In particular, a subsequent auto qs =3D ls;=
 goes from well-formed to ill-formed. I=E2=80=99m certainly open to changin=
g it, but given the variety of opinions in Kona, there should be a discussi=
on to be sure everyone=E2=80=99s on the same page. Also, the range-for case=
 may be considered separately from general deduction. Depending on whether =
the loop declaration is auto&& or an object, meaning changes only by removi=
ng constness or only by changing copy operations to moves, respectively. Ei=
ther of which is potentially breaking, but much less risky than ripping out=
 copy-constructibility.

> and also
>=20
> std::vector< std::string > vs =3D { "yizzo" }; // OK: move from sequence

This only changes meaning with a library change. Also, I was instructed to =
add motivation with a performance micro-benchmark graph showing the improve=
ment on this example. So while there may be some controversy, a proposal ch=
ange is less likely and may not touch EWG anyway.

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/EFFD45A5-AB48-47F9-93D7-B90F85BB0789%40gmail.com=
..

--Apple-Mail=_F6124A75-E701-4889-B14A-19BC37C5D640
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2016=E2=80=9310=
=E2=80=9327, at 3:16 PM, Ville Voutilainen &lt;<a href=3D"mailto:ville.vout=
ilainen@gmail.com" class=3D"">ville.voutilainen@gmail.com</a>&gt; wrote:</d=
iv><br class=3D"Apple-interchange-newline"><div class=3D""><div class=3D"">=
I don't necessarily know of cases outside those two examples, because those=
<br class=3D"">two examples are what changes meaning. The paper provides a =
similar example,<br class=3D""><br class=3D"">auto ls =3D { std::string( "h=
ello" ) }; // ls has type<br class=3D"">std::own_initializer_list&lt; std::=
string &gt;<br class=3D""></div></div></blockquote><div><br class=3D""></di=
v><div>This is the controversial case. In particular, a subsequent <font fa=
ce=3D"Courier" class=3D"">auto qs =3D ls;</font> goes from well-formed to i=
ll-formed. I=E2=80=99m certainly open to changing it, but given the variety=
 of opinions in Kona, there should be a discussion to be sure everyone=E2=
=80=99s on the same page. Also, the range-for case may be considered separa=
tely from general deduction. Depending on whether the loop declaration is&n=
bsp;<span style=3D"font-family: Courier;" class=3D"">auto&amp;&amp;</span>&=
nbsp;or an object,&nbsp;meaning changes only by removing constness or only =
by changing copy operations to moves, respectively. Either of which is pote=
ntially breaking, but much less risky than ripping out copy-constructibilit=
y.</div><br class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""=
><div class=3D"">and also<br class=3D""><br class=3D"">std::vector&lt; std:=
:string &gt; vs =3D { "yizzo" }; // OK: move from sequence<br class=3D""></=
div></div></blockquote></div><br class=3D""><div class=3D"">This only chang=
es meaning with a library change. Also, I was instructed to add motivation =
with a performance micro-benchmark graph showing the improvement on this ex=
ample. So while there may be some controversy, a proposal change is less li=
kely and may not touch EWG anyway.</div><div class=3D""><br class=3D""></di=
v></body></html>

<p></p>

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

--Apple-Mail=_F6124A75-E701-4889-B14A-19BC37C5D640--

.