220 25890 <CADbh+eRNz+n9rFbXS=SKLZ-z2GM7J_tymWgti5P66hEOF_Ungg@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Brent Friedman <fourthgeek@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: RFC - memory management algorithms
Date: Tue, 10 May 2016 23:32:08 -0500
Lines: 272
Approved: news@gmane.org
Message-ID: <CADbh+eRNz+n9rFbXS=SKLZ-z2GM7J_tymWgti5P66hEOF_Ungg@mail.gmail.com>
References: <CADbh+eTtav6T2Gp_dFEba2WLW7Ap5ziZ7KWUDWK46WaEGiyFmg@mail.gmail.com>
	<3d1f34cb-5376-f565-7b31-be27c5e2da0f@f2.dion.ne.jp>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a1141ab60471fc20532898621
X-Trace: ger.gmane.org 1462941132 19150 80.91.229.3 (11 May 2016 04:32:12 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 11 May 2016 04:32:12 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCHLPXGUXMJBBSHLZK4QKGQEGXXC2TI@isocpp.org Wed May 11 06:32:12 2016
Return-path: <std-proposals+bncBCHLPXGUXMJBBSHLZK4QKGQEGXXC2TI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf0-f199.google.com ([209.85.192.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCHLPXGUXMJBBSHLZK4QKGQEGXXC2TI@isocpp.org>)
	id 1b0Loh-0002tV-Iu
	for gclcip-std-proposals@m.gmane.org; Wed, 11 May 2016 06:32:11 +0200
Original-Received: by mail-pf0-f199.google.com with SMTP id 203sf63580161pfy.2
        for <gclcip-std-proposals@m.gmane.org>; Tue, 10 May 2016 21:32:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:date:message-id:subject:from: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=IAPcLP72orX/EqfMoKC8EfFl74RQ3JbuPASUNANtsoM=;
        b=kMzZTOy7zaCkQ0o9UZ0P8+lD2/u6mDhC5geqW6VkznrJF4Hqu6Y54mq9AoG3ZH3Ulu
         879tSyox/2CpTMweiMYX+Gyzh+8dgEj/TJ++JHVg4BE7cgm3+bV/V6WdDFndKoDOfR4L
         Q2Z94hTtEpDtpfJ0Ftl8Z3qtMPiQ8MTs04WAQvmsVt0Z+l3UVDXl160WdQFC7PMTjj6s
         VIj+noD5GXtRNTRSMQnUD5L+sIRidTiPSc9miHGG08TqixwmFtHHbO/S63na3/pGPfak
         lRYLApF33ytFVF2/gwXTSrcTtqVmZOn3QbvzLKy+3ywCrSty1SHcj7SD762/x/r7mVcW
         PLZw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from: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=IAPcLP72orX/EqfMoKC8EfFl74RQ3JbuPASUNANtsoM=;
        b=SnDU8eqjrF4ET4lYcweQPoLyLJnq5dOzz77jJY7KrGectVRGfRN8SDSS7Oy5eSybJc
         7TtqMMZfBGBM64CABM2AMoYn/kS/bRGTYhd/6epBipjPZSNYIBbq3O8+ywBZRMGB6vhK
         47+DFsfYWtJGZDU9VFx9UfjskBCngQbMr88QS43JizZBDPulxsItrxqXi2IS9eVtdfmK
         mpUW8UNBuwXEqqMF4Mnn6TmrLNYD+DPnRIYy50JSukgTrW5+PFEzooqW1XGF5662znug
         3ohwpoqari5SGYIkcKhUapE9HkqPV5iORT10KPc9sf1JnStz309fZ/2pHOCMvj6Dr2gG
         KQVA==
X-Gm-Message-State: AOPr4FV5nxLV3YhgmfZfvRTnTmovu9kPd4gf91bK+HFN1qBAaS+gXh0BMhZ8Gk1kL2VqGA==
X-Received: by 10.66.157.229 with SMTP id wp5mr811644pab.35.1462941129800;
        Tue, 10 May 2016 21:32:09 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.10.169 with SMTP id 38ls249285otq.47.gmail; Tue, 10 May
 2016 21:32:08 -0700 (PDT)
X-Received: by 10.202.225.66 with SMTP id y63mr656677oig.193.1462941128588;
        Tue, 10 May 2016 21:32:08 -0700 (PDT)
Original-Received: from mail-oi0-x230.google.com (mail-oi0-x230.google.com. [2607:f8b0:4003:c06::230])
        by mx.google.com with ESMTPS id 188si1994684oie.49.2016.05.10.21.32.08
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 10 May 2016 21:32:08 -0700 (PDT)
Received-SPF: pass (google.com: domain of fourthgeek@gmail.com designates 2607:f8b0:4003:c06::230 as permitted sender) client-ip=2607:f8b0:4003:c06::230;
Original-Received: by mail-oi0-x230.google.com with SMTP id x19so49376891oix.2
        for <std-proposals@isocpp.org>; Tue, 10 May 2016 21:32:08 -0700 (PDT)
X-Received: by 10.157.57.200 with SMTP id y66mr560665otb.169.1462941128267;
 Tue, 10 May 2016 21:32:08 -0700 (PDT)
Original-Received: by 10.182.98.42 with HTTP; Tue, 10 May 2016 21:32:08 -0700 (PDT)
In-Reply-To: <3d1f34cb-5376-f565-7b31-be27c5e2da0f@f2.dion.ne.jp>
X-Original-Sender: fourthgeek@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 fourthgeek@gmail.com designates 2607:f8b0:4003:c06::230 as permitted sender)
 smtp.mailfrom=fourthgeek@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: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:25890
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/25890>

--001a1141ab60471fc20532898621
Content-Type: text/plain; charset=UTF-8

>
> Will you be in Oulu?
>

Hi Patrice! Yes, I'm booked to be in Oulu for the whole week.


Katsutoshi Satoda, thanks for the detailed feedback! See below:


>  I don't see what "move-assignment of arrays" mean: builtin arrays can't

 be assigned. Does it mean the behavior of a default move constructor of

 a class with non static data member of array type?


That's unfortunate. I forgot that assignment of arrays isn't a thing. Maybe
I'll change this to refer to std::array or something else. Hm.


The proposed wording says:
> >   Remarks: If an exception is thrown there are no effects on the range
> >     [first,last).


You're right, this was intended to be "... no effects on the range [result,
advance(result, distance(first,last))) ". IE, no effects on the destination
rather than no effects on the source.


 "[first, first + count)" is more consistent with other descriptions.

See fill_n() for example.


As I understand, this + syntax is enabled by specific wording. n4582
25.1.12 devotes an entire paragraph to describing what + means in this
context. I went with advance to avoid copy-pasting that. Would it be better
to copy-paste this paragraph from [algorithms.general]?

On Sat, May 7, 2016 at 9:29 AM, Kazutoshi Satoda <k_satoda@f2.dion.ne.jp>
wrote:

> On 2016/05/06 0:59 +0900, Brent Friedman wrote:
> > The paper proposes the following new algorithms:
> >
> > uninitialized_value_construct, uninitialized_value_construct_n
> > uninitialized_default_construct, uninitialized_default_construct_n
> > uninitialized_move, uninitialized_move_n
> > destroy, destroy_n, destroy_at
>
> From "III. Discussion" about uninitialized_move():
> > Our approach to this problem is to emulate existing behavior throughout
> > the language and library. uninitialized_move should behave like
> > move-assignment of arrays. Namely, the constructed objects in the
> > desination buffer are destroyed and the exception is propagated. This
> > matches the behavior of uninitialized_copy and the behavior of algorithm
> > move.
> ("desination" here looks a typo of "destination")
>
> I don't see what "move-assignment of arrays" mean: builtin arrays can't
> be assigned. Does it mean the behavior of a default move constructor of
> a class with non static data member of array type?
>
> The algorithm move() doesn't destroy the destination on an exception. So
> the mention here looks inappropriate.
>
> The proposed wording says:
> >   Remarks: If an exception is thrown there are no effects on the range
> >     [first,last).
> I couldn't see what "on the range [first,last)" is meant for. It looks
> saying nothing about the destination, meaning it doesn't match the above
> quoted discussion. Also, "no effects on the range [first,last)" sounds
> requiring to move back to the original range before destroying the
> destination. But it is impossible in general. To match the above quoted
> discussion, I think the Remarks should be like this:
>   Remarks: If an exception is thrown there are no effects except
>     possibly leaving some objects in the range [first,last) moved from.
> Same issue applies to uninitialized_move_n().
>
>
> The following are some editorial issues:
>
> The names of Size argument of uninitialized_move_n() are inconsistent:
>   - "Size s" at synopsis
>   - "Size count" at declaration in [uninitialized.move]
>   - "n" in Effects
>
> In Remarks on uninitialized_move_n(),
> >   Remarks: If an exception is thrown there are no effects on the range
> >     [first,advance(first,count)).
> "[first, first + count)" is more consistent with other descriptions.
> See fill_n() for example.
>
> --
> k_satoda
>
> --
> 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/3d1f34cb-5376-f565-7b31-be27c5e2da0f%40f2.dion.ne.jp
> .
>

-- 
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/CADbh%2BeRNz%2Bn9rFbXS%3DSKLZ-z2GM7J_tymWgti5P66hEOF_Ungg%40mail.gmail.com.

--001a1141ab60471fc20532898621
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:r=
gb(204,204,204);padding-left:1ex">Will you be in Oulu?<br></blockquote><div=
><br></div><div>Hi Patrice! Yes, I&#39;m booked to be in Oulu for the whole=
 week.</div><div><br></div><div><br></div><div>Katsutoshi Satoda, thanks fo=
r the detailed feedback! See below:</div><div>=C2=A0</div><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;bo=
rder-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">=
=C2=A0<span style=3D"font-size:12.8px">I don&#39;t see what &quot;move-assi=
gnment of arrays&quot; mean: builtin arrays can&#39;t</span>=C2=A0</blockqu=
ote><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bor=
der-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,20=
4);padding-left:1ex">=C2=A0<span style=3D"font-size:12.8px">be assigned. Do=
es it mean the behavior of a default move constructor of</span>=C2=A0</bloc=
kquote><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;=
border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204=
,204);padding-left:1ex">=C2=A0<span style=3D"font-size:12.8px">a class with=
 non static data member of array type?</span></blockquote><div><span style=
=3D"font-size:12.8px"><br></span></div><div><span style=3D"font-size:12.8px=
">That&#39;s unfortunate. I forgot that assignment of arrays isn&#39;t a th=
ing. Maybe I&#39;ll change this to refer to std::array or something else. H=
m.</span></div><div><span style=3D"font-size:12.8px"><br></span></div><div>=
<span style=3D"font-size:12.8px"><br></span></div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-lef=
t-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span st=
yle=3D"font-size:12.8px">The proposed wording says:</span><br style=3D"font=
-size:12.8px"><span style=3D"font-size:12.8px">&gt;=C2=A0 =C2=A0Remarks: If=
 an exception is thrown there are no effects on the range</span><br style=
=3D"font-size:12.8px"><span style=3D"font-size:12.8px">&gt;=C2=A0 =C2=A0 =
=C2=A0[first,last).</span></blockquote><div><br></div><div>You&#39;re right=
, this was intended to be &quot;... no effects on the range [result, advanc=
e(result, distance(first,last))) &quot;. IE, no effects on the destination =
rather than no effects on the source.</div><div>=C2=A0</div><div><span styl=
e=3D"font-size:12.8px"><br></span><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;=
border-left-color:rgb(204,204,204);padding-left:1ex">=C2=A0<span style=3D"f=
ont-size:12.8px">&quot;[first, first + count)&quot; is more consistent with=
 other descriptions.</span>=C2=A0</blockquote><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-st=
yle:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span style=
=3D"font-size:12.8px">See fill_n() for example.</span></blockquote></div><d=
iv><span style=3D"font-size:12.8px"><br></span></div><div><span style=3D"fo=
nt-size:12.8px">As I understand, this + syntax is enabled by specific wordi=
ng. n4582 25.1.12 devotes an entire paragraph to describing what + means in=
 this context. I went with advance to avoid copy-pasting that. Would it be =
better to copy-paste this paragraph from [algorithms.general]?</span></div>=
</div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Sat, May=
 7, 2016 at 9:29 AM, Kazutoshi Satoda <span dir=3D"ltr">&lt;<a href=3D"mail=
to:k_satoda@f2.dion.ne.jp" target=3D"_blank">k_satoda@f2.dion.ne.jp</a>&gt;=
</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .=
8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=3D"">On 2016/0=
5/06 0:59 +0900, Brent Friedman wrote:<br>
&gt; The paper proposes the following new algorithms:<br>
&gt;<br>
&gt; uninitialized_value_construct, uninitialized_value_construct_n<br>
&gt; uninitialized_default_construct, uninitialized_default_construct_n<br>
&gt; uninitialized_move, uninitialized_move_n<br>
&gt; destroy, destroy_n, destroy_at<br>
<br>
</span>From &quot;III. Discussion&quot; about uninitialized_move():<br>
&gt; Our approach to this problem is to emulate existing behavior throughou=
t<br>
&gt; the language and library. uninitialized_move should behave like<br>
&gt; move-assignment of arrays. Namely, the constructed objects in the<br>
&gt; desination buffer are destroyed and the exception is propagated. This<=
br>
&gt; matches the behavior of uninitialized_copy and the behavior of algorit=
hm<br>
&gt; move.<br>
(&quot;desination&quot; here looks a typo of &quot;destination&quot;)<br>
<br>
I don&#39;t see what &quot;move-assignment of arrays&quot; mean: builtin ar=
rays can&#39;t<br>
be assigned. Does it mean the behavior of a default move constructor of<br>
a class with non static data member of array type?<br>
<br>
The algorithm move() doesn&#39;t destroy the destination on an exception. S=
o<br>
the mention here looks inappropriate.<br>
<br>
The proposed wording says:<br>
&gt;=C2=A0 =C2=A0Remarks: If an exception is thrown there are no effects on=
 the range<br>
&gt;=C2=A0 =C2=A0 =C2=A0[first,last).<br>
I couldn&#39;t see what &quot;on the range [first,last)&quot; is meant for.=
 It looks<br>
saying nothing about the destination, meaning it doesn&#39;t match the abov=
e<br>
quoted discussion. Also, &quot;no effects on the range [first,last)&quot; s=
ounds<br>
requiring to move back to the original range before destroying the<br>
destination. But it is impossible in general. To match the above quoted<br>
discussion, I think the Remarks should be like this:<br>
=C2=A0 Remarks: If an exception is thrown there are no effects except<br>
=C2=A0 =C2=A0 possibly leaving some objects in the range [first,last) moved=
 from.<br>
Same issue applies to uninitialized_move_n().<br>
<br>
<br>
The following are some editorial issues:<br>
<br>
The names of Size argument of uninitialized_move_n() are inconsistent:<br>
=C2=A0 - &quot;Size s&quot; at synopsis<br>
=C2=A0 - &quot;Size count&quot; at declaration in [uninitialized.move]<br>
=C2=A0 - &quot;n&quot; in Effects<br>
<br>
In Remarks on uninitialized_move_n(),<br>
&gt;=C2=A0 =C2=A0Remarks: If an exception is thrown there are no effects on=
 the range<br>
&gt;=C2=A0 =C2=A0 =C2=A0[first,advance(first,count)).<br>
&quot;[first, first + count)&quot; is more consistent with other descriptio=
ns.<br>
See fill_n() for example.<br>
<br>
--<br>
k_satoda<br>
<span class=3D""><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%2Bunsubscribe@isocpp.org">std-propo=
sals+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>
</span>To view this discussion on the web visit <a href=3D"https://groups.g=
oogle.com/a/isocpp.org/d/msgid/std-proposals/3d1f34cb-5376-f565-7b31-be27c5=
e2da0f%40f2.dion.ne.jp" rel=3D"noreferrer" target=3D"_blank">https://groups=
..google.com/a/isocpp.org/d/msgid/std-proposals/3d1f34cb-5376-f565-7b31-be27=
c5e2da0f%40f2.dion.ne.jp</a>.<br>
</blockquote></div><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/CADbh%2BeRNz%2Bn9rFbXS%3DSKLZ-z2GM7J_=
tymWgti5P66hEOF_Ungg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CADbh%2BeRN=
z%2Bn9rFbXS%3DSKLZ-z2GM7J_tymWgti5P66hEOF_Ungg%40mail.gmail.com</a>.<br />

--001a1141ab60471fc20532898621--

.
