220 29832 <20161216124658.4919375.82156.21506@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: Fri, 16 Dec 2016 07:46:58 -0500
Lines: 68
Approved: news@gmane.org
Message-ID: <20161216124658.4919375.82156.21506@gmail.com>
References: <13702f32-32c2-447f-9996-3624fd678675@isocpp.org>
 <CAEddoJZxM5qe9qVfags_iNrd0YpvUo2xmSw-OqifnHJ+4wJtxA@mail.gmail.com>
 <CAFk2RUZ9MjM=jCd2YkHHVjurPZB7mscgzbxnOjdLWqZStp0bBQ@mail.gmail.com>
 <CAEddoJb9BfQzhoWxLz4-QvD-PkEupxucguMvQEETfcUM7Ed=JA@mail.gmail.com>
 <CAFk2RUb4-hGZq8ZDNR=eMv2erJK+8UH8Qj=SNeG+9DBW678Wkw@mail.gmail.com>
 <CAEddoJbQAx5Pne+qu4A92Pd=NgiLQsj8auGuJHeZiKmz1fouQg@mail.gmail.com>
 <CAFk2RUZ-Xm2cQ6jCwQaSAhF+sCudqnHeivrJvqCQ4mhKv9rN+g@mail.gmail.com>
 <CAEddoJZ+AR_UC_xheJnkn4yBg7iny3_BHNXHOa1M1+iZEpuqiQ@mail.gmail.com>
 <CAFk2RUYq+_To254SGVAesMfZtFJDLSVmLvU=U3bhBq83xZdA1w@mail.gmail.com>
 <c8c29792-37a9-2eb1-1a5e-69ccfe247661@gmail.com>
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 1481892430 3464 195.159.176.226 (16 Dec 2016 12:47:10 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 16 Dec 2016 12:47:10 +0000 (UTC)
To: =?utf-8?q?Jonathan_M=C3=BCller?= <std-proposals@isocpp.org>, std-proposals@isocpp.org, Jonathan Coe <jbcoe@me.com>, Jonathan Coe <jonathanbcoe@gmail.com>
Original-X-From: std-proposals+bncBCUZ5QWKNQIMJRGPYICRUBCXTVV6Y@isocpp.org Fri Dec 16 13:47:04 2016
Return-path: <std-proposals+bncBCUZ5QWKNQIMJRGPYICRUBCXTVV6Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb0-f200.google.com ([209.85.213.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCUZ5QWKNQIMJRGPYICRUBCXTVV6Y@isocpp.org>)
	id 1cHruc-0007WV-Cb
	for gclcip-std-proposals@m.gmane.org; Fri, 16 Dec 2016 13:46:58 +0100
Original-Received: by mail-yb0-f200.google.com with SMTP id h184sf104726444ybb.7
        for <gclcip-std-proposals@m.gmane.org>; Fri, 16 Dec 2016 04:47:03 -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=72KSsS7m74lrXViF0fJGqF1xHnDPcU1Jj/bCkztGNQA=;
        b=M35vfTiBCKa0G6+tZuINyO1eQeM5eGowtofGuZfcsVMsS8wiNtdVqemum4JjQJek9z
         V7wH7S2rmJvCMqHwYHl0Ber2PfdT0KW/j2RV3twpRoegteAb4Zha3gJq/Egn9+gX+tCv
         GLjg7xDytHOO8Awvxb9RQQLHYAvci1iDLv7YFWNozawBRPjxKvpZcmvj0yDuG+PRFBIq
         hOWaPwMbmmbJBymABTSEuChELDi90/ubAneKuEbPbBKsuHhDNnD6vIxW/DpUtOkGNG1e
         mxPNfW+ynnP0deZiihpZ3gHbLNUw2Rt7xLjGYYh+dcYMzWjXepRVnR0rTa7bsUUmdoTv
         PfnQ==
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=72KSsS7m74lrXViF0fJGqF1xHnDPcU1Jj/bCkztGNQA=;
        b=fIbPeaWkC7wV99DsdEXTg0eifTTwFZQ/xdDdo9ZXgluqJp9jhUe9XpA21MIHnrj6HW
         H4wFn6gaFJf9gHB/lH2ND1rnmLYdUseIjVBhu8uWKElRazKAD/puO/5nNyxRzLWtfKW5
         zQXSXhImYvA3ZiTDqcBOmtXqzmhogDGlIoHOQw+TYvrTPi34nxW0str6bV0Z0uHIHOWZ
         v5xz5hfLk/pJZfyOFiuqZu1qXyIWo91kTBFtvzj8RplsdoTn07SZ9FFSMXQHUD8oEVLQ
         ktKhNhwFwDL9CGIqe0XppqCQFPICm9/ZxUphOfwzALC25YkkkHUlSXP+7OBFqEV/USRz
         VqZ 
X-Gm-Message-State: AKaTC02ywdwlMFvMmkahneHRf0/Y0Jyu8/gXwy8WjW0K7kXp41mCy4RnzbfWpz6vZhpEhA==
X-Received: by 10.129.135.133 with SMTP id x127mr643160ywf.164.1481892422575;
        Fri, 16 Dec 2016 04:47:02 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.117.7 with SMTP id y7ls548589itc.0.gmail; Fri, 16 Dec 2016
 04:47:00 -0800 (PST)
X-Received: by 10.107.17.105 with SMTP id z102mr2893226ioi.165.1481892420265;
        Fri, 16 Dec 2016 04:47:00 -0800 (PST)
Original-Received: from mail-it0-x242.google.com (mail-it0-x242.google.com. [2607:f8b0:4001:c0b::242])
        by mx.google.com with ESMTPS id 5si5860665iow.0.2016.12.16.04.47.00
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 16 Dec 2016 04:47:00 -0800 (PST)
Received-SPF: pass (google.com: domain of tvaneerd@gmail.com designates 2607:f8b0:4001:c0b::242 as permitted sender) client-ip=2607:f8b0:4001:c0b::242;
Original-Received: by mail-it0-x242.google.com with SMTP id b123so2453685itb.2
        for <std-proposals@isocpp.org>; Fri, 16 Dec 2016 04:47:00 -0800 (PST)
X-Received: by 10.36.66.143 with SMTP id i137mr3311564itb.43.1481892420031;
        Fri, 16 Dec 2016 04:47:00 -0800 (PST)
Original-Received: from [127.0.0.1] ([74.15.44.73])
        by smtp.gmail.com with ESMTPSA id k130sm1251840ita.20.2016.12.16.04.46.58
        (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
        Fri, 16 Dec 2016 04:46:58 -0800 (PST)
X-Mailer: BlackBerry Email (10.3.2.2876)
In-Reply-To: <c8c29792-37a9-2eb1-1a5e-69ccfe247661@gmail.com>
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:c0b::242 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:29832
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29832>

It sounds to me like this may be another difference between clone_ptr and p=
olymorphic value. And more reason to have both.

Sent=C2=A0from=C2=A0my=C2=A0BlackBerry=C2=A0portable=C2=A0Babbage=C2=A0Devi=
ce
=C2=A0 Original Message =C2=A0
From: Jonathan M=C3=BCller
Sent: Friday, December 16, 2016 7:36 AM
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 16.12.2016 13:25, Jonathan Wakely wrote:
> p0201r1 deals with that problem, which is why it's a better approach.

On 16.12.2016 13:28, Ville Voutilainen wrote:
> Like the proposed std::indirect? I got the impression that its latest
> feedback was to move it
> closer to value semantics of a polymorphic type.

Yeah, exactly. I like `std::indirect`, it behaves like a `T` and has
consistent semantics.

> But I do, otherwise I wouldn't have chosen a cloned_ptr.

Alright, hard to argue with that and I get your arguments.

I just don't think that's particularly "clean".
If the type wasn't polymorphic you'd embed it as a member directly,
so copying will copy all members and moving will move all members.
But if you change it to use a polymorphic type you use a cloning_ptr,
so copy will still copy everything but moving will suddenly leave the=20
type with an "empty" member?
I wouldn't like using that struct with that change.

There might be a possible use case for cloning_ptr,
but I don't think its as a member.
And if you don't use it is a member,
you don't need a copy constructor but can use a free function.

> All pointers are a mix between "optional" and something else since
> they can be null. And that's
> just fine for many cases.

I meant on a semantic point of view: mix between value semantics and=20
ownership transfer.


--=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/c8c29792-37a9-2eb1-1a5e-69ccfe247661%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/20161216124658.4919375.82156.21506%40gmail.com.

.
