220 20546 <6D75256B-F476-4BA4-BA13-D2342F8B7B6B@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: Mon, 21 Sep 2015 14:25:51 +0800
Lines: 95
Approved: news@gmane.org
Message-ID: <6D75256B-F476-4BA4-BA13-D2342F8B7B6B@gmail.com>
References: <BAE02C11-9AC8-41F8-BD3C-A2C9B33F9794@gmail.com> <87343e65-eecd-4b96-86b7-a883aa7f9d1d@isocpp.org> <ADB6E3C0-AD21-41A1-86AA-3DE2637BEABC@gmail.com> <CADGW59mVUmCTVN+CSVnk+LCmTvFXBf1YR_L5X1dfEgoKEPF8FQ@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=_36507162-5AD5-431B-BFDF-1350E26C4CC4"
X-Trace: ger.gmane.org 1442816782 10707 80.91.229.3 (21 Sep 2015 06:26:22 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 21 Sep 2015 06:26:22 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCW25A7E3QCRBBWG72XQKGQEC6J6IBQ@isocpp.org Mon Sep 21 08:26:16 2015
Return-path: <std-proposals+bncBCW25A7E3QCRBBWG72XQKGQEC6J6IBQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ig0-f197.google.com ([209.85.213.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCW25A7E3QCRBBWG72XQKGQEC6J6IBQ@isocpp.org>)
	id 1ZduYK-0008V8-7l
	for gclcip-std-proposals@m.gmane.org; Mon, 21 Sep 2015 08:26:16 +0200
Original-Received: by igbgg5 with SMTP id gg5sf176206207igb.1
        for <gclcip-std-proposals@m.gmane.org>; Sun, 20 Sep 2015 23:26:15 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:content-type:message-id:mime-version
         :subject:date:references:to:in-reply-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=m6gyXcOAKQCqCGWlisncTp2oKAmsfVl8KDfZ9vDwzos=;
        b=Uvr4OEv5W6silbkL7fdJxi4kdfkfwwitGIUcZ3fRd3WQUHjbbczESEAy69/OIa0136
         wAG08RfX+sefA5NbecQqaxUZ4y+XUtqlMGKzbQt60L3Z8xMSDPQejycq4uOjt0tw2uSx
         5R7BNCuoqg5CpJuopPfbzcFq6ntWtL7JyPBQhKvxYLKHGlILwbv3kAX/X+Jv3HKWNmsQ
         Jo6KIphU2r5GS/6zbSyCYwTuTWevV4pe0hsC1nYxUDaeWbLrUIqT1GAVxg0ph7NgFMjj
         w42jeMj1tJztQRi72cKZxTqd2L81rYCWSnrPwigN7odMClLXE4efLPVyiS3Zm3ueH1kp
         CIgA==
X-Gm-Message-State: ALoCoQk4WL7jR5yHs8r/2+vr/LY7fBCJ4DZFY+4l5YG5hFILVw7Y+CU+/05MZXoy1/pO6hUytWal
X-Received: by 10.182.213.166 with SMTP id nt6mr16687112obc.3.1442816775361;
        Sun, 20 Sep 2015 23:26:15 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.29.52 with SMTP id g20ls758898igh.23.gmail; Sun, 20 Sep
 2015 23:26:14 -0700 (PDT)
X-Received: by 10.68.185.132 with SMTP id fc4mr22646513pbc.96.1442816774598;
        Sun, 20 Sep 2015 23:26:14 -0700 (PDT)
Original-Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com. [2607:f8b0:400e:c03::22f])
        by mx.google.com with ESMTPS id gd3si35434978pbb.75.2015.09.20.23.26.14
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 20 Sep 2015 23:26:14 -0700 (PDT)
Received-SPF: pass (google.com: domain of potswa@gmail.com designates 2607:f8b0:400e:c03::22f as permitted sender) client-ip=2607:f8b0:400e:c03::22f;
Original-Received: by pacex6 with SMTP id ex6so107654157pac.0
        for <std-proposals@isocpp.org>; Sun, 20 Sep 2015 23:26:14 -0700 (PDT)
X-Received: by 10.68.133.13 with SMTP id oy13mr2116577pbb.125.1442816774166;
        Sun, 20 Sep 2015 23:26:14 -0700 (PDT)
Original-Received: from [172.20.10.2] ([121.54.54.46])
        by smtp.gmail.com with ESMTPSA id rx8sm11758543pbb.90.2015.09.20.23.26.11
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sun, 20 Sep 2015 23:26:13 -0700 (PDT)
In-Reply-To: <CADGW59mVUmCTVN+CSVnk+LCmTvFXBf1YR_L5X1dfEgoKEPF8FQ@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::22f 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:20546
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/20546>

--Apple-Mail=_36507162-5AD5-431B-BFDF-1350E26C4CC4
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9309=E2=80=9321, at 1:41 PM, Tomasz Kami=C5=84ski <tomaszka=
m@gmail.com> wrote:
>=20
> However, I still think that removing the move-constructor would be benefi=
cial. The existence of the move-constructor and the name (own_initializer_l=
ist) suggest that the list object actually manages storage and moves it fro=
m one object to another. As the own_initializer_list is effectively wrapped=
 reference to stack allocated array, it cannot do that, so the current desi=
gn is misleading.

Does a std::vector (or, as you mention, unique_ptr<T[]>) =E2=80=9Cmove stor=
age from one object to another=E2=80=9D? Aside from user-replaced ::operato=
r new or watching the stack pointer, and aside from the restricted capabili=
ties of the list, what=E2=80=99s the observable difference between own_init=
ializer_list and unique_ptr<T[]>?

> What is motivation for own_initializer_list being move-able? It's existen=
ce suggest user that the class behaves more like unique_ptr<T[]> than refer=
ence to stack array.

Please see =C2=A74.4 Ownership, from the second paragraph onward.

Note that a moved-from list does not destroy any sequence, even one it was =
directly initialized with.

--=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=_36507162-5AD5-431B-BFDF-1350E26C4CC4
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=9321, at 1:41 PM, Tomasz Kami=C5=84ski &lt;<a href=3D"mailto:tomaszk=
am@gmail.com" class=3D"">tomaszkam@gmail.com</a>&gt; wrote:</div><br class=
=3D"Apple-interchange-newline"><div class=3D""><div dir=3D"ltr" class=3D"">=
<div class=3D"gmail_extra">However, I still think that removing the move-co=
nstructor would be beneficial. The existence of the move-constructor and th=
e name (own_initializer_list) suggest that the list object actually manages=
 storage and moves it from one object to another. As the own_initializer_li=
st is effectively wrapped reference to stack allocated array, it cannot do =
that, so the current design is misleading.</div></div></div></blockquote><d=
iv><br class=3D""></div><div>Does a <font face=3D"Courier" class=3D"">std::=
vector</font>&nbsp;(or, as you mention,&nbsp;<span style=3D"font-family: Co=
urier;" class=3D"">unique_ptr&lt;T[]&gt;</span>) =E2=80=9Cmove storage from=
 one object to another=E2=80=9D? Aside from user-replaced <font face=3D"Cou=
rier" class=3D"">::operator new</font> or watching the stack pointer, and a=
side from the restricted capabilities of the list, what=E2=80=99s the obser=
vable difference between <font face=3D"Courier" class=3D"">own_initializer_=
list</font> and <font face=3D"Courier" class=3D"">unique_ptr&lt;T[]&gt;</fo=
nt>?</div><div><br class=3D""></div><blockquote type=3D"cite" class=3D""><d=
iv class=3D""><div dir=3D"ltr" class=3D""><div class=3D"gmail_extra"><div c=
lass=3D"gmail_quote"><div class=3D"">What is motivation for own_initializer=
_list being move-able? It's existence suggest user that the class behaves m=
ore like unique_ptr&lt;T[]&gt; than reference to stack array.</div></div></=
div></div></div></blockquote><br class=3D""></div><div>Please see =C2=A74.4=
 <i class=3D"">Ownership</i>, from the second paragraph onward.</div><div><=
br class=3D""></div><div>Note that a moved-from list does not destroy any s=
equence, even one it was directly initialized with.</div><div><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=_36507162-5AD5-431B-BFDF-1350E26C4CC4--

.
