220 29877 <20161217171633.4919375.58072.21574@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Tony V E <tvaneerd@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 12:16:33 -0500
Lines: 71
Approved: news@gmane.org
Message-ID: <20161217171633.4919375.58072.21574@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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1481994998 5117 195.159.176.226 (17 Dec 2016 17:16:38 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 17 Dec 2016 17:16:38 +0000 (UTC)
To: Manuel Bergler <std-proposals@isocpp.org>, std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCUZ5QWKNQIPHZOVYICRUBE2OQ72M@isocpp.org Sat Dec 17 18:16:32 2016
Return-path: <std-proposals+bncBCUZ5QWKNQIPHZOVYICRUBE2OQ72M@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f198.google.com ([209.85.161.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCUZ5QWKNQIPHZOVYICRUBE2OQ72M@isocpp.org>)
	id 1cIIb2-0000Qt-BF
	for gclcip-std-proposals@m.gmane.org; Sat, 17 Dec 2016 18:16:32 +0100
Original-Received: by mail-yw0-f198.google.com with SMTP id l139sf93795012ywe.5
        for <gclcip-std-proposals@m.gmane.org>; Sat, 17 Dec 2016 09:16:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:content-transfer-encoding:message-id:date:subject:from
         :in-reply-to:references: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=zpvqrYqO9MZF54ihgHgONWXRCCB45utjTJsbrvSOTdo=;
        b=CK+kZdZYzy65+AvQs4K09aRVHPGELM/CDc/wZmMETcDyXMydsGCDkIi1IwM2hYyGRk
         lwDSlJjHtOA7WsCitGaosaNGH8ghPbsvFH1sYYGTVU+sUjV9h8D2vTAlmTXLh3xDi4dp
         OlTycVMhSuHGiWonaaHATJsQGVNlOetOQB8xilKwJFxeoRZO2cJbTC4dO3UwJjMu96dE
         2xbo9XGYJLXaE3D5aynpQnnQaee84tmQSE7KTdORRDN2BYLN7McBrUMHD1q8jPyBJb2j
         9UwMaY5nhJUfTOYBoBcooWpKKG4RLhHN+bk6rJbqHSErpsurdax04zOFvIiaU3POyU/S
         cYkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:content-transfer-encoding
         :message-id:date:subject:from:in-reply-to:references: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=zpvqrYqO9MZF54ihgHgONWXRCCB45utjTJsbrvSOTdo=;
        b=qP46AqDXfz+ZWW+GHJ5mkd4jVcZiEpX5nUibYoF3mKFi8s5aWjQDvG3+SeWaYQQ6Yc
         tq6R9mHDd6plnwCzuD4jrlvzb8x7Mex3oBtGiUemFaAxtJ+0povH6APrQUMwO/SP2W9y
         LuEN/Z6g6tr4+eKxTGiKe10XZjCYEmHlyreOCy+hPiYjb4a902PPFoK7frVQ32UmQ3Ag
         yIv3OnKJR07Mfnnxz10h3rHleWPMgyxaR2CExzpzdKntgRpN1teoAHg0LnDibBSr8BlX
         uzyPyVwjiVrGdjdWh4wBex242o+EIDPfknHUYsbCk9LciPP+TppWeSEULLjtCWS/Il5i
         Z3+ 
X-Gm-Message-State: AKaTC01eg+mKZgWdg2c0bhYDgHGkfqFTRjPKueDPJBLsDe+CFtLyI0KvKSaruDHnAsRUTQ==
X-Received: by 10.13.237.5 with SMTP id w5mr1948205ywe.21.1481994996448;
        Sat, 17 Dec 2016 09:16:36 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.130.7 with SMTP id t7ls1269024itd.20.canary-gmail; Sat, 17
 Dec 2016 09:16:35 -0800 (PST)
X-Received: by 10.36.204.9 with SMTP id x9mr9710051itf.123.1481994995356;
        Sat, 17 Dec 2016 09:16:35 -0800 (PST)
Original-Received: from mail-io0-x241.google.com (mail-io0-x241.google.com. [2607:f8b0:4001:c06::241])
        by mx.google.com with ESMTPS id u186si6148424itf.113.2016.12.17.09.16.35
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sat, 17 Dec 2016 09:16:35 -0800 (PST)
Received-SPF: pass (google.com: domain of tvaneerd@gmail.com designates 2607:f8b0:4001:c06::241 as permitted sender) client-ip=2607:f8b0:4001:c06::241;
Original-Received: by mail-io0-x241.google.com with SMTP id b194so15052587ioa.3
        for <std-proposals@isocpp.org>; Sat, 17 Dec 2016 09:16:35 -0800 (PST)
X-Received: by 10.107.133.76 with SMTP id h73mr9668815iod.148.1481994994812;
        Sat, 17 Dec 2016 09:16:34 -0800 (PST)
Original-Received: from [127.0.0.1] ([74.15.44.73])
        by smtp.gmail.com with ESMTPSA id d25sm2008815ioj.30.2016.12.17.09.16.33
        for <std-proposals@isocpp.org>
        (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
        Sat, 17 Dec 2016 09:16:33 -0800 (PST)
X-Mailer: BlackBerry Email (10.3.2.2876)
In-Reply-To: <20161217170428.GA10214@manuel-ThinkPad-L440.localdomain>
X-Original-Sender: tvaneerd@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of tvaneerd@gmail.com
 designates 2607:f8b0:4001:c06::241 as permitted sender) smtp.mailfrom=tvaneerd@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:29877
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29877>

=E2=80=8E>=C2=A0I might miss something here, but I can't think of a use-cas=
e where the convenience of returning it from a function by value having it =
implicitly clone the pointee with `return my_clone_ptr;` instead of just wr=
iting `return my_clone_ptr.clone();`

Templates. Where you don't know if T has .clone(). Cloning in C++ is typica=
lly spelled with the copy-constructor.=C2=A0



Sent=C2=A0from=C2=A0my=C2=A0BlackBerry=C2=A0portable=C2=A0Babbage=C2=A0Devi=
ce
=C2=A0 Original Message =C2=A0
From: Manuel Bergler
Sent: Saturday, December 17, 2016 12:05 PM
To: std-proposals@isocpp.org
Reply To: std-proposals@isocpp.org
Subject: Re: [std-proposals] New smart pointer: CopyConstructible and CopyA=
ssignable flavor of unique_ptr

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.

--=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/20161217171633.4919375.58072.21574%40gmail.com.

.
