220 15647 <CADvuK0+eGB3bHCi=yM_+KiQuCXwsN1QVp-_CtcXTOk8mPAiBTg@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: "Arthur O'Dwyer" <arthur.j.odwyer@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: RFC: Adding Symmetry Between shared_ptr and weak_ptr
Date: Tue, 13 Jan 2015 16:02:06 -0800
Lines: 107
Approved: news@gmane.org
Message-ID: <CADvuK0+eGB3bHCi=yM_+KiQuCXwsN1QVp-_CtcXTOk8mPAiBTg@mail.gmail.com>
References: <ac147cea-63cd-44c6-a1d6-ee5bef29d072@isocpp.org>
	<e07e1c8d-f1f0-4381-8ea8-b225d91aaa76@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=089e0102f2123a34d2050c9173f6
X-Trace: ger.gmane.org 1421193732 31267 80.91.229.3 (14 Jan 2015 00:02:12 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 14 Jan 2015 00:02:12 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDLZJYWNDQIP7Y6WUUCRUBHGMDLNU@isocpp.org Wed Jan 14 01:02:08 2015
Return-path: <std-proposals+bncBDLZJYWNDQIP7Y6WUUCRUBHGMDLNU@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-la0-f69.google.com ([209.85.215.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDLZJYWNDQIP7Y6WUUCRUBHGMDLNU@isocpp.org>)
	id 1YBBPU-0008VS-91
	for gclcip-std-proposals@m.gmane.org; Wed, 14 Jan 2015 01:02:08 +0100
Original-Received: by mail-la0-f69.google.com with SMTP id gd6sf3215211lab.0
        for <gclcip-std-proposals@m.gmane.org>; Tue, 13 Jan 2015 16:02:07 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:content-type: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=NwmhTZVkofIpBUCXl7D+BB00zL8AlQqBZOhO5uFuOAM=;
        b=aALJDB+iA+faQ4FadvSyZgU7VwsYJvBvouX09ZohGMSqroj0HgphgUCp8Mq7e0GrNp
         N7FULFNjf2eLfPpHqF7MYm2AZhYnNRD45yzcr8asVOt7Vk1H+NsViRSMsiAbblKruMgW
         NEA8LBkosGSHMufbuAxHL8n6rT5ikxl1ESOYLNuIW90L4HXvm2HueDBB5QRmb8CkYwk6
         Ix/CmXp4CT4ZofJ+NQwtsTJTPdvzeRhXhTsZICdKtM68fnkiepFhQ3T8JoI75CW6FGQS
         2tDzglc4X1wn/k7jKnW/OW1xJQ9mjgnieOo2HCbGQJwYg6A6XlkskG9BFG+T3dLgeJXC
         J/LQ==
X-Gm-Message-State: ALoCoQn7gYKeNHMpeeOSNiIkYlnC0n5ni6aP/dPdiUQIhUFbCZZ1Ep6W599cMn7JkEQzJ9ifRnfU
X-Received: by 10.152.37.193 with SMTP id a1mr118713lak.3.1421193727664;
        Tue, 13 Jan 2015 16:02:07 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.20.37 with SMTP id k5ls120152wie.40.gmail; Tue, 13 Jan
 2015 16:02:06 -0800 (PST)
X-Received: by 10.194.185.243 with SMTP id ff19mr1687140wjc.126.1421193726837;
        Tue, 13 Jan 2015 16:02:06 -0800 (PST)
Original-Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com. [2a00:1450:400c:c00::22c])
        by mx.google.com with ESMTPS id js4si44585093wjc.159.2015.01.13.16.02.06
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 13 Jan 2015 16:02:06 -0800 (PST)
Received-SPF: pass (google.com: domain of arthur.j.odwyer@gmail.com designates 2a00:1450:400c:c00::22c as permitted sender) client-ip=2a00:1450:400c:c00::22c;
Original-Received: by mail-wg0-f44.google.com with SMTP id y19so5975156wgg.3
        for <std-proposals@isocpp.org>; Tue, 13 Jan 2015 16:02:06 -0800 (PST)
X-Received: by 10.194.108.162 with SMTP id hl2mr1677377wjb.134.1421193726536;
 Tue, 13 Jan 2015 16:02:06 -0800 (PST)
Original-Received: by 10.217.2.18 with HTTP; Tue, 13 Jan 2015 16:02:06 -0800 (PST)
In-Reply-To: <e07e1c8d-f1f0-4381-8ea8-b225d91aaa76@isocpp.org>
X-Original-Sender: arthur.j.odwyer@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of arthur.j.odwyer@gmail.com designates 2a00:1450:400c:c00::22c as
 permitted sender) smtp.mail=arthur.j.odwyer@gmail.com;       dkim=pass
 header.i=@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: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:15647
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/15647>

--089e0102f2123a34d2050c9173f6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Tue, Jan 13, 2015 at 3:24 PM, <jgottman6@gmail.com> wrote:

> On Saturday, January 10, 2015 at 2:01:54 PM UTC-5, Arthur O'Dwyer wrote:
>
>> I've got a rough draft of a proposal for the next meeting in May, and
>> would like to hear anyone's feedback on the format and content before th=
en.
>>
>> https://quuxplusone.github.io/draft/Nweak_ptr_proposal.html
>>
>
>
Just one minor quibble.  I don't see the use case for the weak_ptr overload
> that takes a pointer and a weak_ptr.  The pointer should always be some
> kind of sub-object of an object pointed to by a shared_ptr, such as a dat=
a
> member or container element.  For you to have this pointer and know that =
it
> is still valid, you should still have access to the shared_ptr owning it.
> Therefore, you should be able to construct your new weak_ptr from the
> pointer and the shared_ptr.
>

I'm not convinced that your analysis is correct in all possible use-cases.
(Maybe we only have a weak_ptr at this point in the program, and we don't
wish to lock it unnecessarily, and for some reason we *can* compute the
appropriate raw pointer without evaluating the weak_ptr.)

However, you're right in that shared_ptr(weak_ptr<Y> const&, T*) doesn't
exist, so I'm not adding any symmetry via this particular overload. I'm
mulling it over.

=E2=80=93Arthur

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--089e0102f2123a34d2050c9173f6
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Tue, Jan 13, 2015 at 3:24 PM,  <span dir=3D"ltr">&lt;<a=
 href=3D"mailto:jgottman6@gmail.com" target=3D"_blank">jgottman6@gmail.com<=
/a>&gt;</span> wrote:=C2=A0<div><div class=3D"gmail_extra"><div class=3D"gm=
ail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.=
8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-st=
yle:solid;padding-left:1ex"><div dir=3D"ltr">On Saturday, January 10, 2015 =
at 2:01:54 PM UTC-5, Arthur O&#39;Dwyer wrote:<br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;bo=
rder-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">=
<div dir=3D"ltr"><div>I&#39;ve got a rough draft of a proposal for the next=
 meeting in May, and would like to hear anyone&#39;s feedback on the format=
 and content before then.</div><div><br></div><a href=3D"https://quuxpluson=
e.github.io/draft/Nweak_ptr_proposal.html" target=3D"_blank">https://quuxpl=
usone.github.io/<u></u>draft/Nweak_ptr_proposal.html</a></div></blockquote>=
</blockquote><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px =
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-=
style:solid;padding-left:1ex"><div dir=3D"ltr">=C2=A0</div></blockquote><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-lef=
t-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padd=
ing-left:1ex"><div dir=3D"ltr">Just one minor quibble.=C2=A0 I don&#39;t se=
e the use case for the weak_ptr overload that takes a pointer and a weak_pt=
r.=C2=A0 The pointer should always be some kind of sub-object of an object =
pointed to by a shared_ptr, such as a data member or container element.=C2=
=A0 For you to have this pointer and know that it is still valid, you shoul=
d still have access to the shared_ptr owning it.=C2=A0 Therefore, you shoul=
d be able to construct your new weak_ptr from the pointer and the shared_pt=
r.</div></blockquote><div><br></div><div>I&#39;m not convinced that your an=
alysis is correct in all possible use-cases. (Maybe we only have a weak_ptr=
 at this point in the program, and we don&#39;t wish to lock it unnecessari=
ly, and for some reason we *can* compute the appropriate raw pointer withou=
t evaluating the weak_ptr.)</div><div><br></div><div>However, you&#39;re ri=
ght in that <font face=3D"monospace, monospace">shared_ptr(weak_ptr&lt;Y&gt=
; const&amp;, T*)</font> doesn&#39;t exist, so I&#39;m not adding any symme=
try via this particular overload. I&#39;m mulling it over.</div><div><br></=
div><div>=E2=80=93Arthur</div></div></div></div></div>

<p></p>

-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--089e0102f2123a34d2050c9173f6--

.
