220 29881 <CAEddoJa4V_UFj7xcNwR_YNqCfbNtEMbXZgsYDyXCx=M51E2xdQ@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: =?UTF-8?Q?Jonathan_M=C3=BCller?= <jonathanmueller.dev@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: New smart pointer: CopyConstructible and
 CopyAssignable flavor of unique_ptr
Date: Sat, 17 Dec 2016 19:14:19 +0100
Lines: 77
Approved: news@gmane.org
Message-ID: <CAEddoJa4V_UFj7xcNwR_YNqCfbNtEMbXZgsYDyXCx=M51E2xdQ@mail.gmail.com>
References: <CAEddoJZxM5qe9qVfags_iNrd0YpvUo2xmSw-OqifnHJ+4wJtxA@mail.gmail.com>
 <67a9e9ed-8748-4098-a43b-33598b516464@isocpp.org> <ad1bfe2f-c769-4938-9f92-8f6b396f03e6@isocpp.org>
 <e30ffb82-0d5f-fafd-39b4-28e60d07c948@gmail.com> <20161217141109.GA22645@manuel-ThinkPad-L440.localdomain>
 <b1c473be-03c1-e4db-f0c4-a23f182c7154@gmail.com> <CAFk2RUYmdj2HwRpP2HhY=xujkFP1e5LYKkg6eOGBOF_yE-3Lcg@mail.gmail.com>
 <3df7e8eb-01a0-7804-f476-504b5a25a9fe@gmail.com> <CAFk2RUaY3+MnXkmvaC=LxgRA_RD_XQpFfX-HT6X3iq1wD7ggCg@mail.gmail.com>
 <20161217170428.GA10214@manuel-ThinkPad-L440.localdomain> <20161217171633.4919375.58072.21574@gmail.com>
 <CAEddoJaAZkeJS9Maj2z0vYGnfuNnJZ+qFFdjeQyesTF5itJxHA@mail.gmail.com> <15884364-3238-41c7-bc5a-aa5595a64ade@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=94eb2c06d7f4cd56140543dea7fa
X-Trace: blaine.gmane.org 1481998465 3737 195.159.176.226 (17 Dec 2016 18:14:25 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 17 Dec 2016 18:14:25 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCUMHC4Z6QGBB7MA23BAKGQEBCXXLVI@isocpp.org Sat Dec 17 19:14:21 2016
Return-path: <std-proposals+bncBCUMHC4Z6QGBB7MA23BAKGQEBCXXLVI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pg0-f70.google.com ([74.125.83.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCUMHC4Z6QGBB7MA23BAKGQEBCXXLVI@isocpp.org>)
	id 1cIJUv-0008HP-Vb
	for gclcip-std-proposals@m.gmane.org; Sat, 17 Dec 2016 19:14:18 +0100
Original-Received: by mail-pg0-f70.google.com with SMTP id b1sf85989329pgc.5
        for <gclcip-std-proposals@m.gmane.org>; Sat, 17 Dec 2016 10:14:22 -0800 (PST)
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:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=r8RopF+x5+B+nP2X6vjN784+WAONjYKtqfUwvA8G/GE=;
        b=RNSTW881rKwuSSsAqtr7ARP3oiZxAF/oaP245cOi8LikEU1L5ZhF0gDLwz36mDrJIl
         a/MSw5GZYb8jr2qb6VVxuFf0Qe2YHUashJUUtkvKOIunSlKb0H0jxBYevkrHaErY5CYz
         OoYmv4XNrthY9Qz6qQ/oBQelqabpZvcVArJeLE7Zs18XK3DUmOEs9/+vMJYGCuzkfrOe
         eZInAYdv/DBei1zbo25tKOZgGmCOA9q5h9FpUjv8iaFDUGtPh3LoNMV5FAkm5m9oLzJl
         sCMzaWi39JLxNZr6JgH8qvUn/9rL1wlmnCIz4F08SK19STAHGZI52N9zSCP2Tklbzb9j
         wBgA==
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=r8RopF+x5+B+nP2X6vjN784+WAONjYKtqfUwvA8G/GE=;
        b=e16VwUcdKZooNYGMi06WyIKogkfvvKXIVkp4kQ1zYVJFfvHLkhUxJbMno6xR3uEpwW
         aKdYP7fWmu08HVysbkbnCBRn/KsrOEM0HUgZEGOFx2vmNSAWvaX2LNW7Mfm5KCKxbfx5
         otznv99QHuqDd85PIQfcmDUtL1oV+d6Zei9BE8rPbdquwC9oXKtq/v4Ax6JOh/Igc5Lu
         RWBmlPp3W23QheiFT+q5nSWnAHRV7RUWI20fbTt3dQRYPGpMertZjzYp+MZN4rwBio7b
         ZX5v4S0xdpqyKMf/thBSHPaEFSaCwCuc69wdXenGjq2LTn9JcQtI3VRTx6OuLOOE4Eis
         Y2ZA==
X-Gm-Message-State: AKaTC01W3xmDjypDCnImbrwPd/+H/56Ap4a7qS6sgouVNQm3sBvzjGT2EChrnpi6lPnHSA==
X-Received: by 10.99.113.75 with SMTP id b11mr4646909pgn.162.1481998462094;
        Sat, 17 Dec 2016 10:14:22 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.29.137 with SMTP id y9ls10391731otd.39.gmail; Sat, 17 Dec
 2016 10:14:21 -0800 (PST)
X-Received: by 10.55.184.3 with SMTP id i3mr8920963qkf.7.1481998461159;
        Sat, 17 Dec 2016 10:14:21 -0800 (PST)
Original-Received: from mail-qk0-x233.google.com (mail-qk0-x233.google.com. [2607:f8b0:400d:c09::233])
        by mx.google.com with ESMTPS id v6si334569qkl.115.2016.12.17.10.14.21
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sat, 17 Dec 2016 10:14:21 -0800 (PST)
Received-SPF: pass (google.com: domain of jonathanmueller.dev@gmail.com designates 2607:f8b0:400d:c09::233 as permitted sender) client-ip=2607:f8b0:400d:c09::233;
Original-Received: by mail-qk0-x233.google.com with SMTP id q130so122191022qke.1
        for <std-proposals@isocpp.org>; Sat, 17 Dec 2016 10:14:21 -0800 (PST)
X-Received: by 10.55.157.198 with SMTP id g189mr4691975qke.13.1481998460603;
 Sat, 17 Dec 2016 10:14:20 -0800 (PST)
Original-Received: by 10.55.74.202 with HTTP; Sat, 17 Dec 2016 10:14:19 -0800 (PST)
Original-Received: by 10.55.74.202 with HTTP; Sat, 17 Dec 2016 10:14:19 -0800 (PST)
In-Reply-To: <15884364-3238-41c7-bc5a-aa5595a64ade@isocpp.org>
X-Original-Sender: jonathanmueller.dev@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 jonathanmueller.dev@gmail.com designates 2607:f8b0:400d:c09::233 as permitted
 sender) smtp.mailfrom=jonathanmueller.dev@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-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:29881
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29881>

--94eb2c06d7f4cd56140543dea7fa
Content-Type: text/plain; charset=UTF-8

On Dec 17, 2016 7:04 PM, "Nicol Bolas" <jmckesson@gmail.com> wrote:
>
> I don't think "might be harmful" is a good enough reason to not have the
type.

I think it's a very compelling reason. I rather have types that can be used
without thinking, because misuse is a compiler error.

> After all, such copying behavior won't break most standard library types.
`vector<clone_ptr>` will work as expected, as will `any`,
`optional<clone_ptr>`, `variant<clone_ptr>`, and so forth.

All of these type work without copy constructing. The only reason you'd
need copy constructing there is if you'd need to insert a copy or copy the
container. The first one is very easy, just call clone, the second requires
a for loop.

> I think it's important to understand that `clone_ptr` is a solution to a
very specific problem, one that isn't exactly common. You shouldn't see a
huge number of these pointers lying around.

Yeah, and that's why I can't really see a compelling use case for them.

-- 
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/CAEddoJa4V_UFj7xcNwR_YNqCfbNtEMbXZgsYDyXCx%3DM51E2xdQ%40mail.gmail.com.

--94eb2c06d7f4cd56140543dea7fa
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<p dir=3D"ltr">On Dec 17, 2016 7:04 PM, &quot;Nicol Bolas&quot; &lt;<a href=
=3D"mailto:jmckesson@gmail.com">jmckesson@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; I don&#39;t think &quot;might be harmful&quot; is a good enough reason=
 to not have the type.</p>
<p dir=3D"ltr">I think it&#39;s a very compelling reason. I rather have typ=
es that can be used without thinking, because misuse is a compiler error.</=
p>
<p dir=3D"ltr">&gt; After all, such copying behavior won&#39;t break most s=
tandard library types. `vector&lt;clone_ptr&gt;` will work as expected, as =
will `any`, `optional&lt;clone_ptr&gt;`, `variant&lt;clone_ptr&gt;`, and so=
 forth.</p>
<p dir=3D"ltr">All of these type work without copy constructing. The only r=
eason you&#39;d need copy constructing there is if you&#39;d need to insert=
 a copy or copy the container. The first one is very easy, just call clone,=
 the second requires a for loop.</p>
<p dir=3D"ltr">&gt; I think it&#39;s important to understand that `clone_pt=
r` is a solution to a very specific problem, one that isn&#39;t exactly com=
mon. You shouldn&#39;t see a huge number of these pointers lying around.</p=
>
<p dir=3D"ltr">Yeah, and that&#39;s why I can&#39;t really see a compelling=
 use case for them.</p>

<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/CAEddoJa4V_UFj7xcNwR_YNqCfbNtEMbXZgsY=
DyXCx%3DM51E2xdQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAEddoJa4V_UFj7=
xcNwR_YNqCfbNtEMbXZgsYDyXCx%3DM51E2xdQ%40mail.gmail.com</a>.<br />

--94eb2c06d7f4cd56140543dea7fa--

.
