220 34038 <CAKiZDp151PprK6Q_Gajnyh0URotphRK98M154jjPQEjAUOkX4Q@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Patrice Roy <patricer@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: std::vector<T, Alloc>::expand_uninitialized
Date: Mon, 21 Aug 2017 21:19:43 -0400
Lines: 98
Approved: news@gmane.org
Message-ID: <CAKiZDp151PprK6Q_Gajnyh0URotphRK98M154jjPQEjAUOkX4Q@mail.gmail.com>
References: <405bc3a4-4fbf-41af-b213-b24894ba2f6e@isocpp.org> <0304ee31-d873-25a5-1ff9-3364e76dff67@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="001a114c71f8f034dc05574d6319"
X-Trace: blaine.gmane.org 1503364788 31444 195.159.176.226 (22 Aug 2017 01:19:48 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 22 Aug 2017 01:19:48 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDSZXMHWZIKBBMEN53GAKGQE4T56UQI@isocpp.org Tue Aug 22 03:19:41 2017
Return-path: <std-proposals+bncBDSZXMHWZIKBBMEN53GAKGQE4T56UQI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f200.google.com ([209.85.161.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDSZXMHWZIKBBMEN53GAKGQE4T56UQI@isocpp.org>)
	id 1djxr1-0007fP-K2
	for gclcip-std-proposals@m.gmane.org; Tue, 22 Aug 2017 03:19:39 +0200
Original-Received: by mail-yw0-f200.google.com with SMTP id q72sf132899043ywg.15
        for <gclcip-std-proposals@m.gmane.org>; Mon, 21 Aug 2017 18:19:46 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1503364786; cv=pass;
        d=google.com; s=arc-20160816;
        b=NH5JUolDIoj31qf8TShDQ34i7hL7WZVlQ48GxJwSQh0hwaxkxFd1Ug8/1TZgkHjHVV
         ytLTjiumOo0me8kDkjXkdbfCo8kcE0WDiyUby839WDKGnIZRcKho1omEi1cS+4yvI8ma
         aS/aRl5Gwda1M2Trbks9qs2WPpVbepX/x4YDE5PYgUYpef1r4jF4y370p6ogcG+Ldvl9
         LzUdaSgmYzD7CoHlhLxeDdEkwcaV+UlRWB+fx+rvLzjwSY0dyU0FfSoqCn80vsaEuWu/
         Inak6emBlNxxz0y2XiJ2aBoNtf0KD0ELfjJ1nF4SSxdFncAR62P//kUJVYXeTyfgMGbG
         nKEQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date
         :from:references:in-reply-to:mime-version:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=sLFAUUqXnRm1vRWe2fFnA3IOdCypnFZvJxtDF0aWzFI=;
        b=L0d6b2c1u4T0DNlXK4T4n9QA/OEfBjQRweS9QrdUBR4eWPEnMuR6oMKDxHKoYomftE
         HT2WhmmtSlMIL3zjvUxQFR/nWaVihOU2gA1Q+TQ7XXpKo+YvYhraWu0HvYd2hRw+n5W9
         vKPtoUMIlfHutCRMkN7hTBlyuDFRGOVZ7lgZbYeAwr544iYLvyElR4dKWwl0G+uc/dD0
         rdckY+qdeHZU8IYJfM2DTaxPBIJNjSe/jmJj50D8IGoADunGRsXBp5uClIyiAKQGGotm
         kmg1dSpK+LauPkwIrn1Q11bTI9kJVCKo9yqNzd52+gvyPU5jNbSuimWpiRtQK+hpETQy
         IBDA==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=oCokBRN/;
       spf=pass (google.com: domain of patricer@gmail.com designates 2607:f8b0:4002:c05::236 as permitted sender) smtp.mailfrom=patricer@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
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:from:date:message-id:subject: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=sLFAUUqXnRm1vRWe2fFnA3IOdCypnFZvJxtDF0aWzFI=;
        b=hq6T4LMs3dKpshUgOljXSXEVEBX2jK9naE2t9q1PXdA9MipkyZ+g2Z0PWSPwaXfaS1
         RuovyqMvjJ76218D6GMtcbrDx11JBEmNrEbL91uteZC5m8mBGsclof2KAsPYPs0weQQq
         DEsM/6JjgTapyLAsTkHZYsTGjejOYssTiL2GVEOrmnQeF40mcAPp1puGNlR2fZEIUnf2
         3JIqWAnE/K1aL13bxgZch+rjJvro6OkzQT9x7m02r62lLG6tQi1lwbSYGYvKRjKae1YC
         i5CPaY7aYDfwa0bfNk2gJD/TURD5QLH8DmZTJx0IQfSUkH51Jj9aMA87Km1kAgB7tdUG
         Gj6g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject: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=sLFAUUqXnRm1vRWe2fFnA3IOdCypnFZvJxtDF0aWzFI=;
        b=tJq5CH0lxpw60s7NtkPue/EVahk6HZYVhOH7SB8J2AbWHrYpPyBjwJCNjuPNDjiJ1E
         /HrHKqC8oetakYHf8cXd2zK6M/okwWmhf1xmNfytSxazRPB/OeI9iAY+MJ+Wf6zXl2nr
         HZfPzQa5/mYcnw/dq0uuZBpD0kmoJuKqZvkJBXWRBsRKiOt0Ib9xBvBi1/AlU9zPU/7m
         d9P2uBOVCvWOZ2MRYpiVWcuBTYeSapE//FdZdQAD78s9MNB8fAZhfimzjXVFt+7aMKii
         sP/TjfWKpCjIQawU4hu9pzRp2nzsvOKSdB87dcEv8wdtj603XT822EgqupTnpQR1DFh0
         k1Rw==
X-Gm-Message-State: AHYfb5i2JunpXycvOuNb7Lv73kmNXGP+AZM+/2R+K0crJInwm2a4kK29
	3ELzIl9NcZKWwELg
X-Received: by 10.129.163.71 with SMTP id a68mr13908751ywh.95.1503364786073;
        Mon, 21 Aug 2017 18:19:46 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.192.65 with SMTP id u62ls6538003itf.2.gmail; Mon, 21 Aug
 2017 18:19:44 -0700 (PDT)
X-Received: by 10.37.45.94 with SMTP id s30mr16653431ybe.321.1503364784756;
        Mon, 21 Aug 2017 18:19:44 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1503364784; cv=none;
        d=google.com; s=arc-20160816;
        b=gCnzZ+FF8Bt6j0ZdLXknCXDkskrxvo2GOYLaHknlP+ulpttl56LdcJNC+0cHOGRbRm
         knDsOViTqejdZ0c2NQZtMDgm6ZU/EX4F1XXNwiIwCEZ9SPRu9qw6IQ2y75WVE7Oal+JK
         ogVpo9uLzf83qEKWrcLUWR4ZTCT1ov2PFUnoev6fRYL70DhTJX/E3oy3WzrlDg6iO0eA
         4GxEXmjF2Ea94PybADKzcKocshtllISXs17Wd7fkUjDi/8PsWk7p9vFqBk+KYJrZJiMB
         1IZU1roigMAuCRiv1MAq6VdBWYt9gwNJGkFwa/BwCilTnyBw8n9hEF7PE4Y7uC9HihSd
         8pfA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:references:in-reply-to:mime-version
         :dkim-signature:arc-authentication-results;
        bh=MAqjXB+eAhYcVzWwFTebtCsECFrOfbJGn7dtUuFpzN4=;
        b=T8/lmHyCpPDGPYNAh6RoA+QM0FUfKTeZ7xDGA68JJIYk5AE3jo0bxDtMkJjRU7TctE
         6S1Ph7x1d/oKKzmczLzEjb1IUTXCZT6AFXqyiRplSGS3Kc4c3VzpNh4/6192r0nAavzO
         j5TsZEPPTsxQ+mWY8QGDNME71zXZflwKp6MXGdbz7/pcTS0g0Kb1BEkm9DPfEfnPfpYN
         5wGDW1HKsvCfePeOxhBU8xDnOfeDaSVzjznv/VNOOeg6+PzCVxQYyJ5G9torqYkXiiQd
         nz6eO3TtsE0IPrcitnJ60T+x+g1NBL1CALVQ/LVV/uQTJfRKBMNiCyPJQWKjYc+2C2pK
         zDvg==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=oCokBRN/;
       spf=pass (google.com: domain of patricer@gmail.com designates 2607:f8b0:4002:c05::236 as permitted sender) smtp.mailfrom=patricer@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Original-Received: from mail-yw0-x236.google.com (mail-yw0-x236.google.com. [2607:f8b0:4002:c05::236])
        by mx.google.com with ESMTPS id o12si3515588ywi.677.2017.08.21.18.19.44
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Mon, 21 Aug 2017 18:19:44 -0700 (PDT)
Received-SPF: pass (google.com: domain of patricer@gmail.com designates 2607:f8b0:4002:c05::236 as permitted sender) client-ip=2607:f8b0:4002:c05::236;
Original-Received: by mail-yw0-x236.google.com with SMTP id s143so100511947ywg.1
        for <std-proposals@isocpp.org>; Mon, 21 Aug 2017 18:19:44 -0700 (PDT)
X-Received: by 10.37.58.130 with SMTP id h124mr631659yba.281.1503364784336;
 Mon, 21 Aug 2017 18:19:44 -0700 (PDT)
Original-Received: by 10.37.195.193 with HTTP; Mon, 21 Aug 2017 18:19:43 -0700 (PDT)
In-Reply-To: <0304ee31-d873-25a5-1ff9-3364e76dff67@gmail.com>
X-Original-Sender: patricer@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=oCokBRN/;       spf=pass
 (google.com: domain of patricer@gmail.com designates 2607:f8b0:4002:c05::236
 as permitted sender) smtp.mailfrom=patricer@gmail.com;       dmarc=pass
 (p=NONE sp=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-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:34038
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/34038>

--001a114c71f8f034dc05574d6319
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

+1. Really looks like a reserve() use-case to me.

2017-08-21 4:29 GMT-04:00 Jonathan M=C3=BCller <jonathanmueller.dev@gmail.c=
om>:

> On 20.08.2017 22:22, Ryan Nicholl wrote:
>
>> My motivating example consists of a serialization routine. Ideally, the
>> serialization routine would expand the vector uninitialized and then wri=
te
>> the data in. This can't be done however, because the resize function wri=
tes
>> 0s to the data thanks to the default allocator's construct method.
>>
>
> Could you clarify why reserve + push_back() doesn't work here?
>
> --
> 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/is
> ocpp.org/d/msgid/std-proposals/0304ee31-d873-25a5-1ff9-
> 3364e76dff67%40gmail.com.
>

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAKiZDp151PprK6Q_Gajnyh0URotphRK98M154jjPQEjAUOk=
X4Q%40mail.gmail.com.

--001a114c71f8f034dc05574d6319
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">+1. Really looks like a reserve() use-case to me.<br></div=
><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">2017-08-21 4:29 =
GMT-04:00 Jonathan M=C3=BCller <span dir=3D"ltr">&lt;<a href=3D"mailto:jona=
thanmueller.dev@gmail.com" target=3D"_blank">jonathanmueller.dev@gmail.com<=
/a>&gt;</span>:<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 20.08=
..2017 22:22, Ryan Nicholl wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
My motivating example consists of a serialization routine. Ideally, the ser=
ialization routine would expand the vector uninitialized and then write the=
 data in. This can&#39;t be done however, because the resize function write=
s 0s to the data thanks to the default allocator&#39;s construct method.<br=
>
</blockquote>
<br></span>
Could you clarify why reserve + push_back() doesn&#39;t work here?<span cla=
ss=3D""><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%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isoc<wbr>pp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/0304ee31-d873-25a5-1ff9-3364e76dff67%=
40gmail.com" rel=3D"noreferrer" target=3D"_blank">https://groups.google.com=
/a/is<wbr>ocpp.org/d/msgid/std-proposals<wbr>/0304ee31-d873-25a5-1ff9-<wbr>=
3364e76dff67%40gmail.com</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/CAKiZDp151PprK6Q_Gajnyh0URotphRK98M15=
4jjPQEjAUOkX4Q%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAKiZDp151PprK6Q_=
Gajnyh0URotphRK98M154jjPQEjAUOkX4Q%40mail.gmail.com</a>.<br />

--001a114c71f8f034dc05574d6319--

.
