220 18339 <F2E7E68D-491E-42AB-87A8-975FD55897B7@mac.com> article
Path: news.gmane.org!not-for-mail
From: David Krauss <potswa@mac.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Use cases for dyn_array
Date: Tue, 02 Jun 2015 01:33:09 +0800
Lines: 110
Approved: news@gmane.org
Message-ID: <F2E7E68D-491E-42AB-87A8-975FD55897B7@mac.com>
References: <a0542458-0240-4644-b313-55e257823db1@isocpp.org>
 <CAFk2RUbREdNuGDaZugxDwG=Ck66LhC4knWTTR-mLGvGktfP5Rg@mail.gmail.com>
 <c6596fb4-ec4b-4263-b60f-ded11e4b9af0@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\))
Content-Type: multipart/alternative;
 boundary="Apple-Mail=_F2B9B983-B131-4BAA-96B1-410AC3130190"
X-Trace: ger.gmane.org 1433180025 10389 80.91.229.3 (1 Jun 2015 17:33:45 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 1 Jun 2015 17:33:45 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBAABB3NOWKVQKGQEHEB63TA@isocpp.org Mon Jun 01 19:33:36 2015
Return-path: <std-proposals+bncBAABB3NOWKVQKGQEHEB63TA@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+bncBAABB3NOWKVQKGQEHEB63TA@isocpp.org>)
	id 1YzTag-00062w-SK
	for gclcip-std-proposals@m.gmane.org; Mon, 01 Jun 2015 19:33:35 +0200
Original-Received: by igbjd9 with SMTP id jd9sf166878508igb.2
        for <gclcip-std-proposals@m.gmane.org>; Mon, 01 Jun 2015 10:33:34 -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:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=0q0AttMRfyg9rBA+lspJthgK+utmJI2TnlCxo9ka+s8=;
        b=HOy/ZH0BfZsozz0N9husfzJwfhJ6IbpVBg+gCag1ZCUqNJ4DcIgAc1zegJCiQ+LKbH
         2K8olhklGInxDOWcS5KjcHd7rS6UirhlClxzu2W2caVt5bW8rHoxKuHwpcUIhHZImPq/
         gjjxNndLdsfF59tBra8y3XZRztXFuJ0xaeAKjv1hgJlABhLGTDd4At+zQRtV62MLozKp
         w/KZl0ru+ol0D3Uo92QJyUJ83VGb7dzJgiil5jhV1b3Z8ZTmVX9m4qvGWoUoZ7nGSecf
         ws8v4jwu7cXN48ZkW0t5nb/2MtFwFftwJVOAHbWFSpuQRQPbwzxNudHlIq9vCBt3t8FT
         NHcA==
X-Gm-Message-State: ALoCoQmCr8W7T8odxH6WucGFqpva9jfNmX3+Kqzxt6AKPO85Mk/SKxvLvymylTUM6dne8ct65DDb
X-Received: by 10.182.16.163 with SMTP id h3mr30492751obd.14.1433180014060;
        Mon, 01 Jun 2015 10:33:34 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.87.68 with SMTP id v4ls122303igz.14.gmail; Mon, 01 Jun 2015
 10:33:33 -0700 (PDT)
X-Received: by 10.70.138.38 with SMTP id qn6mr41764986pdb.119.1433180013332;
        Mon, 01 Jun 2015 10:33:33 -0700 (PDT)
Original-Received: from nk11p04mm-asmtp002.mac.com (nk11p04mm-asmtpout002.mac.com. [17.158.236.237])
        by mx.google.com with ESMTPS id 7si22426656pdg.139.2015.06.01.10.33.33
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128);
        Mon, 01 Jun 2015 10:33:33 -0700 (PDT)
Received-SPF: pass (google.com: domain of potswa@mac.com designates 17.158.236.237 as permitted sender) client-ip=17.158.236.237;
Original-Received: from [172.20.10.2] (unknown [121.54.54.152])
 by nk11p04mm-asmtp002.mac.com
 (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec  4 2014))
 with ESMTPSA id <0NPA00CX40RA0230@nk11p04mm-asmtp002.mac.com> for
 std-proposals@isocpp.org; Mon, 01 Jun 2015 17:33:16 +0000 (GMT)
X-Proofpoint-Virus-Version: vendor=fsecure
 engine=2.50.10432:5.14.151,1.0.33,0.0.0000
 definitions=2015-06-01_07:2015-05-29,2015-06-01,1970-01-01 signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
 suspectscore=1 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0
 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1506010221
In-reply-to: <c6596fb4-ec4b-4263-b60f-ded11e4b9af0@isocpp.org>
X-Mailer: Apple Mail (2.2098)
X-Original-Sender: potswa@mac.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of potswa@mac.com designates 17.158.236.237 as permitted sender)
 smtp.mail=potswa@mac.com;       dmarc=pass (p=NONE dis=NONE) header.from=mac.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <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:18339
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/18339>

--Apple-Mail=_F2B9B983-B131-4BAA-96B1-410AC3130190
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9306=E2=80=9302, at 1:20 AM, Matthew Fioravante <fmatthew58=
76@gmail.com> wrote:
>=20
> unique_ptr<T[]> has some limitations:
>=20
> 1) It doesn't store the size of the block, so you need to either keep tra=
ck of it separately or write a wrapper type, which is essentially what I'm =
talking about.
> 2) It only allows you to construct the objects with the default construct=
or, which can be very limiting, especially for non-copy/non-move types.

Both of these can be solved using a custom allocator.

I've wondered about the omission of std::allocate_unique. Has it ever come =
up?

There would need to be a generic allocator-to-deleter adapter, which should=
 be generally useful and not too difficult. The general case would need to =
store an element count, because that is expected by allocator::deallocate. =
This could be publicly accessible.

--=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=_F2B9B983-B131-4BAA-96B1-410AC3130190
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=9306=
=E2=80=9302, at 1:20 AM, Matthew Fioravante &lt;<a href=3D"mailto:fmatthew5=
876@gmail.com" class=3D"">fmatthew5876@gmail.com</a>&gt; wrote:</div><br cl=
ass=3D"Apple-interchange-newline"><div class=3D""><span style=3D"font-famil=
y: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; fo=
nt-weight: normal; letter-spacing: normal; line-height: normal; orphans: au=
to; text-align: start; text-indent: 0px; text-transform: none; white-space:=
 normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; f=
loat: none; display: inline !important;" class=3D"">unique_ptr&lt;T[]&gt; h=
as some limitations:</span><br style=3D"font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant: normal; font-weight: normal; letter=
-spacing: normal; line-height: normal; orphans: auto; text-align: start; te=
xt-indent: 0px; text-transform: none; white-space: normal; widows: auto; wo=
rd-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><br style=3D"f=
ont-family: Helvetica; font-size: 12px; font-style: normal; font-variant: n=
ormal; font-weight: normal; letter-spacing: normal; line-height: normal; or=
phans: auto; text-align: start; text-indent: 0px; text-transform: none; whi=
te-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-widt=
h: 0px;" class=3D""><span style=3D"font-family: Helvetica; font-size: 12px;=
 font-style: normal; font-variant: normal; font-weight: normal; letter-spac=
ing: normal; line-height: normal; orphans: auto; text-align: start; text-in=
dent: 0px; text-transform: none; white-space: normal; widows: auto; word-sp=
acing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !i=
mportant;" class=3D"">1) It doesn't store the size of the block, so you nee=
d to either keep track of it separately or write a wrapper type, which is e=
ssentially what I'm talking about.</span><br style=3D"font-family: Helvetic=
a; font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; orphans: auto; text-al=
ign: start; text-indent: 0px; text-transform: none; white-space: normal; wi=
dows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D"">=
<span style=3D"font-family: Helvetica; font-size: 12px; font-style: normal;=
 font-variant: normal; font-weight: normal; letter-spacing: normal; line-he=
ight: normal; orphans: auto; text-align: start; text-indent: 0px; text-tran=
sform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-=
text-stroke-width: 0px; float: none; display: inline !important;" class=3D"=
">2) It only allows you to construct the objects with the default construct=
or, which can be very limiting, especially for non-copy/non-move types.</sp=
an><br class=3D""></div></blockquote></div><br class=3D""><div class=3D"">B=
oth of these can be solved using a custom allocator.</div><div class=3D""><=
br class=3D""></div><div class=3D"">I've wondered about the omission of <fo=
nt face=3D"Courier" class=3D"">std::allocate_unique</font>. Has it ever com=
e up?</div><div class=3D""><br class=3D""></div><div class=3D"">There would=
 need to be a generic allocator-to-deleter adapter, which should be general=
ly useful and not too difficult. The general case would need to store an el=
ement count, because that is expected by <font face=3D"Courier" class=3D"">=
allocator::deallocate</font>. This could be publicly accessible.</div></bod=
y></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=_F2B9B983-B131-4BAA-96B1-410AC3130190--

.
