220 29876 <20161217170428.GA10214@manuel-ThinkPad-L440.localdomain> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Manuel Bergler <berglerma@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 18:04:28 +0100
Lines: 70
Approved: news@gmane.org
Message-ID: <20161217170428.GA10214@manuel-ThinkPad-L440.localdomain>
References: <CAEddoJZxM5qe9qVfags_iNrd0YpvUo2xmSw-OqifnHJ+4wJtxA@mail.gmail.com>
 <e1e780b7-34ea-41bf-9aba-22a1eb6a5f3f@isocpp.org>
 <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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l"
X-Trace: blaine.gmane.org 1481994318 1014 195.159.176.226 (17 Dec 2016 17:05:18 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 17 Dec 2016 17:05:18 +0000 (UTC)
User-Agent: Mutt/1.5.24 (2015-08-30)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDOZBAUFX4MRBTHA2XBAKGQEK62LU3I@isocpp.org Sat Dec 17 18:05:13 2016
Return-path: <std-proposals+bncBDOZBAUFX4MRBTHA2XBAKGQEK62LU3I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f72.google.com ([209.85.215.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDOZBAUFX4MRBTHA2XBAKGQEK62LU3I@isocpp.org>)
	id 1cIIQ4-0007RS-VV
	for gclcip-std-proposals@m.gmane.org; Sat, 17 Dec 2016 18:05:13 +0100
Original-Received: by mail-lf0-f72.google.com with SMTP id y21sf16503917lfa.0
        for <gclcip-std-proposals@m.gmane.org>; Sat, 17 Dec 2016 09:05:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:subject:message-id:references:mime-version
         :content-disposition:in-reply-to:user-agent: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=FsL8rF7bbL4RJKN9LoPju8qes6RdqK7bymxXH8zHkLQ=;
        b=jRPQYYm3rdSnDSU/1iPfOI/TQu6b2VacDCzyuIKA0PdJPUaqh3NVqQoY5Z5jUialHV
         Dy4pyE5jakBOHKEJepjE0ayqpcRaYvcVk2MHcBGVgwmtgGmgPP/4o+rztapALmIC1fnf
         jKkx+3iqmTN2cDAevXkJoc5sWXgF53HOmoVW+dlV/3M0WT9AWAhEQVM4zX5P5ag0uPTT
         99FVKs0a+OJpfCEofyF1uigT3wCcOjahQsCHXh59/BJSBHB6nS87gIvEP4ENdOr19/Tr
         5PgdKUFtcgJxQlIph0hrW0x8363tmvPdLlcG13Vg3arTTMr1yIeKiJwLOyNM5RtJWNeX
         se 
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:subject:message-id:references
         :mime-version:content-disposition:in-reply-to:user-agent
         :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=FsL8rF7bbL4RJKN9LoPju8qes6RdqK7bymxXH8zHkLQ=;
        b=E3MNTb/mpe/7xtDGi4SXDJeHKHHpO9guVh5R23HpUudqh5HWffnb2Zzqaavhka8ObC
         bByadsxpYRqpEhu6HWfDUaHI2jtPTf+AcGwye6NI2zHsYvDpMPCBMKoDatRzUzihOaIC
         0CfmUVSMru/Ym9sEv/QI9qX1Vv97VZzkYa6aiJBUdsTkkVoUGUZQtBPHo1KJIST6Dmog
         CzjgpJ0s7Gmd72hE6CBaA7OFI+oJ/r66ZanEy3NNq3h4hnvXs1v8Y4UFNIznb/46Wd+4
         3IrjxtAIRRZ/Uax7GU2R2SBhAE2lpR+4r4+ovieZBa8DO/NHYi2YsRohLlO2aECB6cxt
        
X-Gm-Message-State: AIkVDXL7VkZI3PVv8Kpb9n7vvLjgYt2XzTQY364vj2awdg0wlcMvs6XLn53x0XzomNsijg==
X-Received: by 10.46.8.17 with SMTP id 17mr846027lji.26.1481994317389;
        Sat, 17 Dec 2016 09:05:17 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.140.6 with SMTP id o6ls698335wmd.7.canary-gmail; Sat, 17
 Dec 2016 09:05:15 -0800 (PST)
X-Received: by 10.194.122.101 with SMTP id lr5mr7276635wjb.210.1481994315618;
        Sat, 17 Dec 2016 09:05:15 -0800 (PST)
Original-Received: from mail-wj0-x241.google.com (mail-wj0-x241.google.com. [2a00:1450:400c:c01::241])
        by mx.google.com with ESMTPS id nb7si12311758wjb.12.2016.12.17.09.05.15
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sat, 17 Dec 2016 09:05:15 -0800 (PST)
Received-SPF: pass (google.com: domain of berglerma@gmail.com designates 2a00:1450:400c:c01::241 as permitted sender) client-ip=2a00:1450:400c:c01::241;
Original-Received: by mail-wj0-x241.google.com with SMTP id j10so18315865wjb.3
        for <std-proposals@isocpp.org>; Sat, 17 Dec 2016 09:05:15 -0800 (PST)
X-Received: by 10.194.146.131 with SMTP id tc3mr7584179wjb.129.1481994314985;
        Sat, 17 Dec 2016 09:05:14 -0800 (PST)
Original-Received: from localhost (x5d856f73.dyn.telefonica.de. [93.133.111.115])
        by smtp.gmail.com with ESMTPSA id jm6sm12203444wjb.27.2016.12.17.09.05.13
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
        Sat, 17 Dec 2016 09:05:14 -0800 (PST)
Content-Disposition: inline
In-Reply-To: <CAFk2RUaY3+MnXkmvaC=LxgRA_RD_XQpFfX-HT6X3iq1wD7ggCg@mail.gmail.com>
X-Original-Sender: berglerma@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 berglerma@gmail.com designates 2a00:1450:400c:c01::241 as permitted sender)
 smtp.mailfrom=berglerma@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:29876
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29876>


--XsQoSWH+UP9D9v3l
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Dec 17, 2016 at 06:10:10PM +0200, Ville Voutilainen wrote:
>On 17 December 2016 at 17:35, Jonathan M=C3=BCller
><jonathanmueller.dev@gmail.com> wrote:
>> On 17.12.2016 16:29, Ville Voutilainen wrote:
>>>
>>> Such a type has just one problem: it's close to useless. It doesn't
>>> violate Sean's lofty principles,
>>> but it doesn't solve the problems it's aimed for either.
>>
>>
>> What are the problems it's aimed for exactly?
>
>
>Convenient cloning, and automatic cloning when passed by value or
>returned by value, including when
>wrapped under something else as a member. Needing to manually invoke a
>clone function more or less
>completely defeats that purpose.
>

I might miss something here, but I can't think of a use-case where the conv=
enience of returning it from a function by value having it implicitly clone=
 the pointee with `return my_clone_ptr;` instead of just writing `return my=
_clone_ptr.clone();` is worth sacrificing the clarity of the latter version=
, in particular since you might actually have intended to move it but forgo=
t to call `std::move` on it before returning.

So as far as I can tell the only remaining benefit is that you needn't writ=
e a custom copy/move constructor/assignment operator for a struct/class hav=
ing one of these as a member?


--=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/20161217170428.GA10214%40manuel-ThinkPad-L440.lo=
caldomain.

--XsQoSWH+UP9D9v3l
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEi3F6I6jTgMCHgGvofAJ3kFaTK3oFAlhVcBoACgkQfAJ3kFaT
K3rQuhAAs/KAVJviC5Q1OyII4DTO7ZCWgIgqtU+jyK6g1Y+UJOZubb96UHDSLJ3G
piljmowEOaGbztLlFfs1yhuncqYPV8YMXBp2miX+TkNeS09uIU5rb1bWY4jmd51l
nsiw9e/oTPqdngD83Z/ZyZXGxX2P8cSPiftqbyvWmbus/ai75e1I8TeFPr36llHF
jAgwZcem8P7aoG7zMqEi9Wa3aXyi0wZ29k4bEZvnRuvrZ8tWjF47KJQtZSgqI8AD
FLvXwcskWMrxbpd7OA0hdbGG+oZ9MjJmj4teTcRBiRP2lE5feP5RluE9YG3M3EEH
c/wPmpil3BtuY0oldtCIw3q7hoGXwKC/M/g+4WJugd+BjPNPmrNB4+0ljbiYdJ0b
a8jE/DwC+mVZEWXoNXNLm9MW9TZbO3+DjgoAD4e9lQNWdLDoczAlqgrJK1/K/TV1
uAjofNXkZRO1ztzEL9Rx5QrbZwa8daWi340K/ERH3hTHtzFn+d2cwqDsucdJce6Z
7B4XoLhgLXoB0Xy2BRglxGflZp3k1A5YNzwak1PaEoJUFAo4De3dRtETKdBi1Mpf
FQiPODNCk/Ix2bTveehDmd8CUBUMRh3YxWNisVYA7w6fh983k0vm0AnEcn5y278a
pLvydgiRGLTgMmCOSYUCCvyEwGIWWiWtKI9ABRybUqqGmG0WKvk=
=UjIz
-----END PGP SIGNATURE-----

--XsQoSWH+UP9D9v3l--

.
