220 20514 <37C94EDD-51ED-4A8B-880F-EA9CFEC13A36@gmail.com> article
Path: news.gmane.org!not-for-mail
From: David Krauss <potswa@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Draft D0065: Movable initializer lists, rev. 2
Date: Sun, 20 Sep 2015 13:02:41 +0800
Lines: 159
Approved: news@gmane.org
Message-ID: <37C94EDD-51ED-4A8B-880F-EA9CFEC13A36@gmail.com>
References: <BAE02C11-9AC8-41F8-BD3C-A2C9B33F9794@gmail.com> <CAJ9Jr1bQQhKjqFfL97U4b_nemuY4CwSJiNdcvUcO64xa3nXv0g@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
Content-Type: multipart/alternative; boundary="Apple-Mail=_E954A457-5693-4844-8C91-36033AC67ECE"
X-Trace: ger.gmane.org 1442725381 19980 80.91.229.3 (20 Sep 2015 05:03:01 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 20 Sep 2015 05:03:01 +0000 (UTC)
Cc: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
To: Rodrigo <rcc.dark@gmail.com>
Original-X-From: std-proposals+bncBCW25A7E3QCRB7H37CXQKGQE2543TZI@isocpp.org Sun Sep 20 07:02:57 2015
Return-path: <std-proposals+bncBCW25A7E3QCRB7H37CXQKGQE2543TZI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f72.google.com ([209.85.213.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCW25A7E3QCRB7H37CXQKGQE2543TZI@isocpp.org>)
	id 1ZdWm7-00066V-U4
	for gclcip-std-proposals@m.gmane.org; Sun, 20 Sep 2015 07:02:56 +0200
Original-Received: by vkgd64 with SMTP id d64sf132777209vkg.2
        for <gclcip-std-proposals@m.gmane.org>; Sat, 19 Sep 2015 22:02:54 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:content-type:mime-version:subject:from
         :in-reply-to:date:cc:message-id:references:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=eApXTOGagJd2bBqb+SZYy0YZZDyE8gr5lHvmXlvgBL4=;
        b=QYAHjL5kxM4UQpzbfQzn06zxC0EFxroHWxagrv7TAmBQXFjxqlirQKZqzlygA5St0u
         9BtnOMyw6rVPZUbKnN7YKWBTEGaKIrjH7DR5q60ENcP1rTEGrexVHS1AGZY3nPUBu42K
         ttqMMQsSvFMHSE0KKj8Fkj1cK8kwTQz64T5J4fZW9IWcxo+zr3HYJF6CNW3gDoHxflXH
         oH6LWvecWoyEzJb1frqW19Bq4x8FFMspUCH9IgR7Oc4eUyDi9C5USd0m4bh0UUqU/hEQ
         Pl0+1/PmJENUMks2h1Fa15fABMG5Li2bdtSWKGNytFM0yMcfVkAfayeG7VdiEUQ32P9x
         SKMA==
X-Gm-Message-State: ALoCoQndjhq/GaPFVlw2gWPcG3nVypVuuAt1v2fAKGikfwnTweFh+CcTeAf29eSrzKn9OnDvG3nr
X-Received: by 10.129.76.9 with SMTP id z9mr11404587ywa.35.1442725374350;
        Sat, 19 Sep 2015 22:02:54 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.4.5 with SMTP id g5ls572571igg.6.canary; Sat, 19 Sep 2015
 22:02:52 -0700 (PDT)
X-Received: by 10.50.23.80 with SMTP id k16mr5331310igf.62.1442725372615;
        Sat, 19 Sep 2015 22:02:52 -0700 (PDT)
Original-Received: from mail-pa0-x235.google.com (mail-pa0-x235.google.com. [2607:f8b0:400e:c03::235])
        by mx.google.com with ESMTPS id t70si13053482ioi.204.2015.09.19.22.02.52
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sat, 19 Sep 2015 22:02:52 -0700 (PDT)
Received-SPF: pass (google.com: domain of potswa@gmail.com designates 2607:f8b0:400e:c03::235 as permitted sender) client-ip=2607:f8b0:400e:c03::235;
Original-Received: by padhy16 with SMTP id hy16so86105411pad.1
        for <std-proposals@isocpp.org>; Sat, 19 Sep 2015 22:02:52 -0700 (PDT)
X-Received: by 10.68.202.9 with SMTP id ke9mr16705136pbc.85.1442725372010;
        Sat, 19 Sep 2015 22:02:52 -0700 (PDT)
Original-Received: from [172.20.10.2] ([121.54.44.88])
        by smtp.gmail.com with ESMTPSA id qn5sm12295099pbc.74.2015.09.19.22.02.48
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sat, 19 Sep 2015 22:02:51 -0700 (PDT)
In-Reply-To: <CAJ9Jr1bQQhKjqFfL97U4b_nemuY4CwSJiNdcvUcO64xa3nXv0g@mail.gmail.com>
X-Mailer: Apple Mail (2.2104)
X-Original-Sender: potswa@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of potswa@gmail.com designates 2607:f8b0:400e:c03::235 as permitted
 sender) smtp.mailfrom=potswa@gmail.com;       dkim=pass header.i=@gmail.com;
       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:20514
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/20514>

--Apple-Mail=_E954A457-5693-4844-8C91-36033AC67ECE
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9309=E2=80=9320, at 7:46 AM, Rodrigo <rcc.dark@gmail.com> w=
rote:
>=20
> Hi David, sorry for answering until now.

No worries, you=E2=80=99re still the first.

> The name "std::own_initializer_list" is probably not worse than the alter=
natives ("mutable", "unique", etc), but I think it is too long anyway (and =
I say this even though the name I originally proposed was longer...). The o=
nly alternative I can suggest right now is "std::temporary_list". It could =
mistakenly relate itself (by name) to the "std::get_temporary_buffer" funct=
ion (and friend), but I like it by itself.

The paper already mentions sequence_literal as an alternative, if we were s=
tarting with a clean slate. Previously it was listed together with the othe=
rs. I=E2=80=99ve re-added that bullet in the naming section, plus your sugg=
estion.

> While I was reading the part that says that ~std::own_initializer_list is=
 the responsible of destroying the elements, I had to go back and re-read t=
he part that talks about std::own_initializer_list<my_type> vs std::own_ini=
tializer_list<my_type>&& as an overload. Some code fragment like the follow=
ing:
>=20
> struct my_container {
>    my_container(std::initializer_list<my_type>);
>    my_container(std::own_initializer_list<my_type>);
>    //...
> };
>=20
> is typical when teaching which are the most important constructors in the=
 implementation of a data structure. It could be good idea to add it, other=
wise the explanation could be lost inside all the text (at first I understo=
od that we had to use the && overload, but of course this is wrong).

I=E2=80=99ve added an example of by-value and by-&& overloading.

> I think I didn't understand the part about the "loop hoisting variant" of=
 the static storage optimization. Some time ago I was thinking about an opt=
imization that initializes and leaves constexpr arguments of the initialize=
r_list untouched and only overwrites those that change at runtime from use =
to use. Probably it is similar to the one you mention, but I could be wrong=
..

It=E2=80=99s along those lines. As far as I know (by hearsay) only EDG impl=
ements this. The paper doesn=E2=80=99t go into depth except to mention that=
 it was considered and it shouldn=E2=80=99t present a problem.

> In something much less important, the very first sentence of the paper ha=
s too many commas! I would delete the one after "only=E2=80=9D.

Done.

> Cheers!


Thanks!

--=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/.

--Apple-Mail=_E954A457-5693-4844-8C91-36033AC67ECE
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 2015=E2=80=9309=
=E2=80=9320, at 7:46 AM, Rodrigo &lt;<a href=3D"mailto:rcc.dark@gmail.com" =
class=3D"">rcc.dark@gmail.com</a>&gt; wrote:</div><br class=3D"Apple-interc=
hange-newline"><div class=3D""><div dir=3D"ltr" class=3D""><div class=3D"">=
<div class=3D""><div class=3D""><div class=3D""><div class=3D"">Hi David, s=
orry for answering until now.<br class=3D""></div></div></div></div></div><=
/div></div></blockquote><div><br class=3D""></div><div>No worries, you=E2=
=80=99re still the first.</div><br class=3D""><blockquote type=3D"cite" cla=
ss=3D""><div class=3D""><div dir=3D"ltr" class=3D""><div class=3D""><div cl=
ass=3D""><div class=3D""><div class=3D"">The name "std::own_initializer_lis=
t" is probably not worse than the alternatives ("mutable", "unique", etc), =
but I think it is too long anyway (and I say this even though the name I or=
iginally proposed was longer...). The only alternative I can suggest right =
now is "std::temporary_list". It could mistakenly relate itself (by name) t=
o the "std::get_temporary_buffer" function (and friend), but I like it by i=
tself.<br class=3D""></div></div></div></div></div></div></blockquote><div>=
<br class=3D""></div><div>The paper already mentions <font face=3D"Courier"=
 class=3D"">sequence_literal</font> as an alternative, if we were starting =
with a clean slate. Previously it was listed together with the others. I=E2=
=80=99ve re-added that bullet in the naming section, plus your suggestion.<=
/div><div><br class=3D""></div><blockquote type=3D"cite" class=3D""><div cl=
ass=3D""><div dir=3D"ltr" class=3D""><div class=3D""><div class=3D""><div c=
lass=3D"">While I was reading the part that says that ~std::own_initializer=
_list is the responsible of destroying the elements, I had to go back and r=
e-read the part that talks about std::own_initializer_list&lt;my_type&gt; v=
s std::own_initializer_list&lt;my_type&gt;&amp;&amp; as an overload. Some c=
ode fragment like the following:<br class=3D""><br class=3D""></div>struct =
my_container {<br class=3D""></div>&nbsp;&nbsp; my_container(std::initializ=
er_list&lt;my_type&gt;);<br class=3D""></div>&nbsp;&nbsp; my_container(std:=
:own_initializer_list&lt;my_type&gt;);<br class=3D"">&nbsp;&nbsp; //...<br =
class=3D""><div class=3D""><div class=3D"">};<br class=3D""><br class=3D"">=
</div><div class=3D"">is typical when teaching which are the most important=
 constructors in the implementation of a data structure. It could be good i=
dea to add it, otherwise the explanation could be lost inside all the text =
(at first I understood that we had to use the &amp;&amp; overload, but of c=
ourse this is wrong).<br class=3D""></div></div></div></div></blockquote><d=
iv><br class=3D""></div><div>I=E2=80=99ve added an example of by-value and =
by-<font face=3D"Courier" class=3D"">&amp;&amp;</font> overloading.</div><b=
r class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><div dir=
=3D"ltr" class=3D""><div class=3D""><div class=3D"">I think I didn't unders=
tand the part about the "loop hoisting variant" of the static storage optim=
ization. Some time ago I was thinking about an optimization that initialize=
s and leaves constexpr arguments of the initializer_list untouched and only=
 overwrites those that change at runtime from use to use. Probably it is si=
milar to the one you mention, but I could be wrong.<br class=3D""></div><di=
v class=3D""></div></div></div></div></blockquote><div><br class=3D""></div=
><div>It=E2=80=99s along those lines. As far as I know (by hearsay) only ED=
G implements this. The paper doesn=E2=80=99t go into depth except to mentio=
n that it was considered and it shouldn=E2=80=99t present a problem.</div><=
br class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><div dir=
=3D"ltr" class=3D""><div class=3D""><div class=3D"">In something much less =
important, the very first sentence of the paper has too many commas! I woul=
d delete the one after "only=E2=80=9D.<br class=3D""></div></div></div></di=
v></blockquote><div><br class=3D""></div><div>Done.</div><br class=3D""><bl=
ockquote type=3D"cite" class=3D""><div class=3D""><div dir=3D"ltr" class=3D=
""><div class=3D""><div class=3D"">Cheers!<br class=3D""></div></div></div>=
</div></blockquote></div><div class=3D""><br class=3D""></div>Thanks!<div c=
lass=3D""><br class=3D""></div></body></html>

<p></p>

-- <br />
<br />
--- <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 />
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 />

--Apple-Mail=_E954A457-5693-4844-8C91-36033AC67ECE--

.
