220 20548 <6fb8e5c2-65a8-4a31-a8f0-7ca85b9b7247@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: =?UTF-8?Q?Andrzej_Krzemie=C5=84ski?= <akrzemi1@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Draft D0065: Movable initializer lists, rev. 2
Date: Mon, 21 Sep 2015 00:31:22 -0700 (PDT)
Lines: 122
Approved: news@gmane.org
Message-ID: <6fb8e5c2-65a8-4a31-a8f0-7ca85b9b7247@isocpp.org>
References: <BAE02C11-9AC8-41F8-BD3C-A2C9B33F9794@gmail.com> <87343e65-eecd-4b96-86b7-a883aa7f9d1d@isocpp.org>
 <ADB6E3C0-AD21-41A1-86AA-3DE2637BEABC@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_81_1332031077.1442820683077"
X-Trace: ger.gmane.org 1442820687 10826 80.91.229.3 (21 Sep 2015 07:31:27 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 21 Sep 2015 07:31:27 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDT2DGOJ34DBBTHE72XQKGQEKDXVTDA@isocpp.org Mon Sep 21 09:31:27 2015
Return-path: <std-proposals+bncBDT2DGOJ34DBBTHE72XQKGQEKDXVTDA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ig0-f200.google.com ([209.85.213.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDT2DGOJ34DBBTHE72XQKGQEKDXVTDA@isocpp.org>)
	id 1ZdvZO-0002aM-Aw
	for gclcip-std-proposals@m.gmane.org; Mon, 21 Sep 2015 09:31:26 +0200
Original-Received: by igbbp9 with SMTP id bp9sf177934545igb.3
        for <gclcip-std-proposals@m.gmane.org>; Mon, 21 Sep 2015 00:31:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :content-type:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=gozoRsPNJrKE6o7Dm2rXvCYk8x1QUSuW2j897hf3t1w=;
        b=fNJPVEqBjeaxyoi0qAHNh22l3dAgwSq6n0judTNRLKINEB6sl/qJyGQown15H8+AOB
         ZEO+GEtzmufbmryYJObp3MjcErasjtBg+CBAbYOGR24vBrH+Vi91HkKj16ArE52IiTyG
         uioVfKsxozmiSBmZQtHz817FEwx2lF6uhf4NECujFZrxno34EJHzo0FWroehxa6kAZ6Z
         lIEGTCJUPtAlTAFF8MyvZVXvntvEi4AWJS7mMW+HVjVkXUzvmwut+EFyii+QssVAsSnM
         myhLMsCrrChauBXGJfmomvSC0Gve4kv4pM8cvLOzJkCh1RMVqCLa3/tkY5e05jC4yNIV
         QWkA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:content-type:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=gozoRsPNJrKE6o7Dm2rXvCYk8x1QUSuW2j897hf3t1w=;
        b=hm8/cpuZPDTVibAPliqeG4vaAM9KS5TAOYY+t1JdEMlXdfwyTXqWA6Nq3864Tr6BBf
         la7qT1AEIYueRc627Ps1NZNB/swoli7nIPp+NT0d6aGErI5lBoSpkAwxh4VFvmsRl3wm
         50IyjjFRcyGJ02L/JWhH+xjjUmR2bSZ2OSGosxe4TusQ2eGCxCFwRUbTD1rjcEM5xR9B
         4KE5ZDmVfuxhHtYyifLZ2wkHzDcWTlncjLpE0sGAb4gLSPlSKRo9uHmcF6tOfPErltN9
         R8axRAZX+vFsNbDnCOUrhu0gPKKHetRD9EnwAMPI8QwerUAKvOOQ1eWhFCg8IaYQjILG
         IFxg==
X-Gm-Message-State: ALoCoQmvDI92j3xkJCq1J/Zpt7G4otmq1BeM7N52YsvGEBHrwKMgSncoJsjpK8rk97m3V2fWSOY7
X-Received: by 10.182.241.72 with SMTP id wg8mr15596444obc.2.1442820685433;
        Mon, 21 Sep 2015 00:31:25 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.27.4 with SMTP id p4ls760332igg.11.canary; Mon, 21 Sep 2015
 00:31:24 -0700 (PDT)
X-Received: by 10.50.122.103 with SMTP id lr7mr89674igb.10.1442820684247;
        Mon, 21 Sep 2015 00:31:24 -0700 (PDT)
In-Reply-To: <ADB6E3C0-AD21-41A1-86AA-3DE2637BEABC@gmail.com>
X-Original-Sender: akrzemi1@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:20548
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/20548>

------=_Part_81_1332031077.1442820683077
Content-Type: multipart/alternative; 
	boundary="----=_Part_82_1365006545.1442820683077"

------=_Part_82_1365006545.1442820683077
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



W dniu poniedzia=C5=82ek, 21 wrze=C5=9Bnia 2015 06:13:24 UTC+2 u=C5=BCytkow=
nik David=20
Krauss napisa=C5=82:
>
>
> On 2015=E2=80=9309=E2=80=9321, at 3:02 AM, Tomasz <toma...@gmail.com <jav=
ascript:>> wrote:
>
> I have a question regarding the rationale for keeping=20
> own_initializer_list<T> movable. This still may lead to several dangling=
=20
> reference problems, for example most common one is to treat=20
> own_initializer_list<T> as normal container and store as class member,
>
>
> Declaring a class member of own_initializer_list type is a diagnosable=20
> error. See the last paragraph in =C2=A72:
>
> This likewise requires forbidding cases where initializer_list generates=
=20
> dangling pointers: when it is used as a member, a base class, the value o=
f=20
> a return statement, an exception object, or the type in a *new-expression=
*
> .
>
>
So, you are preventing the bug-prone constructs by a special language rule=
=20
(yet another special rule to be learned by the programmers). In contrast,=
=20
it appears to me that simply deleting the move constructor of=20
*own_initializer_list* would achieve the same result without adding any=20
special rule. Also, only the presence of move constructor may incorrectly=
=20
suggest to the users that there is a transfer of ownership involved.

So, the question is: is the move constructor necessary in your design?

(BTW, Let me just mention that I really like your proposal; only with it,=
=20
will initializer_list be complete.)

Regards,
&rzej

--=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_82_1365006545.1442820683077
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br>W dniu poniedzia=C5=82ek, 21 wrze=C5=9Bnia 2015 06:13:24 UTC+2 u=C5=
=BCytkownik David Krauss napisa=C5=82:<blockquote class=3D"gmail_quote" sty=
le=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left=
: 1ex;"><div style=3D"word-wrap:break-word"><br><div><blockquote type=3D"ci=
te"><div>On 2015=E2=80=9309=E2=80=9321, at 3:02 AM, Tomasz &lt;<a href=3D"j=
avascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"DORg4JueBQAJ" rel=3D=
"nofollow" onmousedown=3D"this.href=3D&#39;javascript:&#39;;return true;" o=
nclick=3D"this.href=3D&#39;javascript:&#39;;return true;">toma...@gmail.com=
</a>&gt; wrote:</div><br><div><div dir=3D"ltr">I have a question regarding =
the rationale for keeping own_initializer_list&lt;T&gt; movable. This still=
 may lead to several dangling reference problems, for example most common o=
ne is to treat own_initializer_list&lt;T&gt; as normal container and store =
as class member,</div></div></blockquote><div><br></div><div>Declaring a cl=
ass member of <font face=3D"Courier">own_initializer_list</font> type is a =
diagnosable error. See the last paragraph in =C2=A72:</div><div><br></div><=
div><blockquote type=3D"cite"><p style=3D"margin:0px 0px 6px">This likewise=
 requires forbidding cases where <span style=3D"font-size:11px;font-family:=
Courier;background-color:rgb(245,245,245)">initializer_list</span> generate=
s dangling pointers: when it is used as a member, a base class, the value o=
f a <span style=3D"font-size:11px;font-family:Courier;background-color:rgb(=
245,245,245)">return</span> statement, an exception object, or the type in =
a <i>new-expression</i>.</p></blockquote></div></div></div></blockquote><di=
v><br>So, you are preventing the bug-prone constructs by a special language=
 rule (yet another special rule to be learned by the programmers). In contr=
ast, it appears to me that simply deleting the move constructor of <b>own_i=
nitializer_list</b> would achieve the same result without adding any specia=
l rule. Also, only the presence of move constructor may incorrectly suggest=
 to the users that there is a transfer of ownership involved.<br><br>So, th=
e question is: is the move constructor necessary in your design?<br><br>(BT=
W, Let me just mention that I really like your proposal; only with it, will=
 initializer_list be complete.)<br><br>Regards,<br>&amp;rzej<br></div><br>

<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 />

------=_Part_82_1365006545.1442820683077--
------=_Part_81_1332031077.1442820683077--

.
