220 15645 <e07e1c8d-f1f0-4381-8ea8-b225d91aaa76@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: jgottman6@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: RFC: Adding Symmetry Between shared_ptr and weak_ptr
Date: Tue, 13 Jan 2015 15:24:46 -0800 (PST)
Lines: 100
Approved: news@gmane.org
Message-ID: <e07e1c8d-f1f0-4381-8ea8-b225d91aaa76@isocpp.org>
References: <ac147cea-63cd-44c6-a1d6-ee5bef29d072@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_4880_1837022587.1421191486289"
X-Trace: ger.gmane.org 1421191496 31179 80.91.229.3 (13 Jan 2015 23:24:56 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 13 Jan 2015 23:24:56 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBD7LHGWIQEPRBPWS22SQKGQER3OTTFQ@isocpp.org Wed Jan 14 00:24:49 2015
Return-path: <std-proposals+bncBD7LHGWIQEPRBPWS22SQKGQER3OTTFQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oi0-f71.google.com ([209.85.218.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBD7LHGWIQEPRBPWS22SQKGQER3OTTFQ@isocpp.org>)
	id 1YBApM-0004r8-8Y
	for gclcip-std-proposals@m.gmane.org; Wed, 14 Jan 2015 00:24:48 +0100
Original-Received: by mail-oi0-f71.google.com with SMTP id u20sf26819480oif.2
        for <gclcip-std-proposals@m.gmane.org>; Tue, 13 Jan 2015 15:24:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :content-type:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=pMX1ykqUn6tXFyGFCIC6kABCjyRr7dXnzXZ5V4RvjbE=;
        b=y3HY7IV0V5aSsyHTgeENsxZJ2dn7wXdQxXRCM3xyljhMv3BzSa7VthY5h/xb6JqCkr
         9f7qmlzcLJ9E5+DWqeMlI58DarVCuq+osM97u5ERD4LipXsoAEghHkFmLuGS22ju/O2w
         RlZtV+FocGASgyR2NORkv0JL/sUQRriz+AF3WzmTOl7YAJbumf5pbLXhFIDJM+nuNkyf
         lWTi0NfF1ZzXJNXnpr3zCvdw1q2s9xgbFAO34JbEPbSUgf3oQkT6oDq81e8/joyeSu5N
         23LXv0xbUq9pGwV3tuiF+iA0fEGKfyfIbqIs15vGCdwx/ZExahohS1JnzxcWE6RLaqBn
         QbsQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:content-type:x-original-sender:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=pMX1ykqUn6tXFyGFCIC6kABCjyRr7dXnzXZ5V4RvjbE=;
        b=isxI736DGiZK2XjbtPE02tQTnOtsNGKQXPInuLmPmi2PD9gKChpdzafWVT5+p1QMHa
         C4m2sa7PyFdQSzUcaPGP0PT42nvKJnjGHSB+sK5U5HjebAo44iwT9pwRr4cWVlBpSLcb
         mS1jEN9stckv0oQQrVGiC/HNKFyMbrnbLx4VwifQo6tI5m6l34+dMp0BhqCxNfQSUCEL
         vsyBVUZjVivhHlgNR7/KYKymr8nwziBfZkoVmfxn/LjnCBglHq9O9+eS2wEllSu9TyST
         smY2uC+V+WotXUk5ZVwph3mXRhtNdRlkaLH395MSj8SoSDqu9Ma8FjrvSlGmUX+Jaqc4
         ak1Q==
X-Gm-Message-State: ALoCoQn8L7o3h7LMSnlv39lBLkH5KSUu9sc2c41Mhx/hA72B3ONjsel8PWA0ieFt0kaePxm8gnWS
X-Received: by 10.42.54.76 with SMTP id q12mr1692196icg.13.1421191487435;
        Tue, 13 Jan 2015 15:24:47 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.22.163 with SMTP id 32ls243860qgn.48.gmail; Tue, 13 Jan
 2015 15:24:46 -0800 (PST)
X-Received: by 10.140.98.132 with SMTP id o4mr764qge.41.1421191486727;
        Tue, 13 Jan 2015 15:24:46 -0800 (PST)
In-Reply-To: <ac147cea-63cd-44c6-a1d6-ee5bef29d072@isocpp.org>
X-Original-Sender: jgottman6@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:15645
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/15645>

------=_Part_4880_1837022587.1421191486289
Content-Type: multipart/alternative; 
	boundary="----=_Part_4881_466226790.1421191486289"

------=_Part_4881_466226790.1421191486289
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Just one minor quibble.  I don't see the use case for the weak_ptr overload=
=20
that takes a pointer and a weak_ptr.  The pointer should always be some=20
kind of sub-object of an object pointed to by a shared_ptr, such as a data=
=20
member or container element.  For you to have this pointer and know that it=
=20
is still valid, you should still have access to the shared_ptr owning it. =
=20
Therefore, you should be able to construct your new weak_ptr from the=20
pointer and the shared_ptr.

Joe Gottman

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=20
> would like to hear anyone's feedback on the format and content before the=
n.
>
> https://quuxplusone.github.io/draft/Nweak_ptr_proposal.html
>
> The TL;DR is that it proposes two very small new library features:
> - shared_ptr::unlock(), which turns a shared_ptr into a weak_ptr,=20
> symmetric with weak_ptr::lock()
> - An two-argument constructor for weak_ptr(), symmetric with shared_ptr's=
=20
> two-argument constructor
>
> =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/.

------=_Part_4881_466226790.1421191486289
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Just one minor quibble.&nbsp; I don't see the use case for=
 the weak_ptr overload that takes a pointer and a weak_ptr.&nbsp; The point=
er should always be some kind of sub-object of an object pointed to by a sh=
ared_ptr, such as a data member or container element.&nbsp; For you to have=
 this pointer and know that it is still valid, you should still have access=
 to the shared_ptr owning it.&nbsp; Therefore, you should be able to constr=
uct your new weak_ptr from the pointer and the shared_ptr.<br><br>Joe Gottm=
an<br><br>On Saturday, January 10, 2015 at 2:01:54 PM UTC-5, Arthur O'Dwyer=
 wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.=
8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>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 then.</div>=
<div><br></div><a href=3D"https://quuxplusone.github.io/draft/Nweak_ptr_pro=
posal.html" target=3D"_blank" onmousedown=3D"this.href=3D'https://www.googl=
e.com/url?q\75https%3A%2F%2Fquuxplusone.github.io%2Fdraft%2FNweak_ptr_propo=
sal.html\46sa\75D\46sntz\0751\46usg\75AFQjCNEpCBJmD4KOlkKAXe6DwO0kgU69zQ';r=
eturn true;" onclick=3D"this.href=3D'https://www.google.com/url?q\75https%3=
A%2F%2Fquuxplusone.github.io%2Fdraft%2FNweak_ptr_proposal.html\46sa\75D\46s=
ntz\0751\46usg\75AFQjCNEpCBJmD4KOlkKAXe6DwO0kgU69zQ';return true;">https://=
quuxplusone.github.io/<wbr>draft/Nweak_ptr_proposal.html</a><br><div><br></=
div><div>The TL;DR is that it proposes two very small new library features:=
</div><div>- shared_ptr::unlock(), which turns a shared_ptr into a weak_ptr=
, symmetric with weak_ptr::lock()</div><div>- An two-argument constructor f=
or weak_ptr(), symmetric with shared_ptr's two-argument constructor</div><d=
iv><br></div><div>=E2=80=93Arthur</div></div></blockquote></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 />

------=_Part_4881_466226790.1421191486289--
------=_Part_4880_1837022587.1421191486289--

.
