220 28941 <CAFk2RUZC6anr-MkMA37H3LKM235Uxh0Y6z58KyvRK-4h3R6+Rw@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Is World's Dumbest Pointer still on the table?!?
Date: Tue, 18 Oct 2016 18:45:47 +0300
Lines: 37
Approved: news@gmane.org
Message-ID: <CAFk2RUZC6anr-MkMA37H3LKM235Uxh0Y6z58KyvRK-4h3R6+Rw@mail.gmail.com>
References: <8a6731f7-1c9b-482d-817e-c2374fc9ae1b@isocpp.org>
 <nu53qp$lvv$1@blaine.gmane.org> <7d817482-e7c3-4724-9501-738d4c9083d7@isocpp.org>
 <CAFk2RUYggLMwivpFr+thZmRBUXBgXC283iwAvyRQEnbT7xrqUA@mail.gmail.com>
 <f3d2848e-56f7-4ddd-a0a0-1a8c7b8db391@isocpp.org> <CAOHCbiskO5DpTwym8nH=yra+Ypa-+b-ycfSV+34JLjPqC8ST4g@mail.gmail.com>
 <4d9aa487-c824-490a-ae3a-ac90e2a2db3d@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: blaine.gmane.org 1476805568 11601 195.159.176.226 (18 Oct 2016 15:46:08 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 18 Oct 2016 15:46:08 +0000 (UTC)
To: "ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC5JHI7A7ALRBLEHTHAAKGQEZWBDGXY@isocpp.org Tue Oct 18 17:46:03 2016
Return-path: <std-proposals+bncBC5JHI7A7ALRBLEHTHAAKGQEZWBDGXY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-it0-f72.google.com ([209.85.214.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBLEHTHAAKGQEZWBDGXY@isocpp.org>)
	id 1bwWaJ-0000gh-FS
	for gclcip-std-proposals@m.gmane.org; Tue, 18 Oct 2016 17:45:47 +0200
Original-Received: by mail-it0-f72.google.com with SMTP id w141sf2105557itc.3
        for <gclcip-std-proposals@m.gmane.org>; Tue, 18 Oct 2016 08:45:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject: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=N2QjlGdoE/0YWHNIJbA07YfRTNfkNNOgJ/NdqdhXkAA=;
        b=cfKL0WqwQ5YDofCHk9jgESBOoN/8+E4ne7+KKNfC6XScK/Cyh1PcRUPn50gBdmHrWp
         JWO8v3dFsiVKj+oiidwfRumOdWrfZT2jTNIyw3EBg2L1hzLXaKx8HneqmZz3R76HFKI+
         IXVwLR0OfxkKtSb8jJMxHJ7oUjo6uIeyYbVBiUtSqhXVmDhx2xmsKAcSFuvpwOCMJQCB
         kVUJ+0W/Gc7upXt3ZDj4zIRsMFMf3BtZhbP8Q9T1LjKqk9Tfjs/JJlFsBI/57GrbfDLA
         wD1qSw0Gr5D7k9ua8mal1Dp5Uy34NAVO5UpfnO7u6Q2tvR7IR0/kpqhbXdZ8mUhzL2A5
         KhDQ==
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:from:date
         :message-id:subject: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=N2QjlGdoE/0YWHNIJbA07YfRTNfkNNOgJ/NdqdhXkAA=;
        b=idHE2lpqVb+LfPyKTZoabJ4OTHMQ4rdmiDzMYnpBQaG0k6wFElwL4S4C35m9N2m+ke
         97HYxtEjXdSnW1qDixkhLZHu4UFVmIM0bx+cSJO9rViTPO+6dop4td31jHSiV+gPuLR2
         1Qmh01kYPR7agXP+bbqvFnb9BgYX85Xfo/d7PuzeasZlmKpi5DmNbktzOxLxtKLkHcTC
         ktf1yQFmxURiot1lUeTerRbAJWjP/PwhJTwJi/c3JDRRKfOT+QJqhjR/TtRLFly0k91D
         p3avuK4RQqZrYrUT8+gsi912qP5YTzmiyXZ7N6HVRq1+2XgC42U/WwiY5q/kB7QaH9y+
         TI1g==
X-Gm-Message-State: AA6/9RkDrYUFMn2nnexY2gjbHC0DlcBa/TaJBj0kV3dtdrodTpsR52FMTvTzpLE1egyquA==
X-Received: by 10.36.74.2 with SMTP id k2mr3258643itb.21.1476805549535;
        Tue, 18 Oct 2016 08:45:49 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.9.229 with SMTP id 98ls55984ioj.10.gmail; Tue, 18 Oct 2016
 08:45:48 -0700 (PDT)
X-Received: by 10.107.146.67 with SMTP id u64mr1804419iod.34.1476805548348;
        Tue, 18 Oct 2016 08:45:48 -0700 (PDT)
Original-Received: from mail-io0-x236.google.com (mail-io0-x236.google.com. [2607:f8b0:4001:c06::236])
        by mx.google.com with ESMTPS id b133si2127711iti.117.2016.10.18.08.45.48
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 18 Oct 2016 08:45:48 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:4001:c06::236 as permitted sender) client-ip=2607:f8b0:4001:c06::236;
Original-Received: by mail-io0-x236.google.com with SMTP id f5so1940428ioj.2
        for <std-proposals@isocpp.org>; Tue, 18 Oct 2016 08:45:48 -0700 (PDT)
X-Received: by 10.107.10.100 with SMTP id u97mr1846493ioi.107.1476805548012;
 Tue, 18 Oct 2016 08:45:48 -0700 (PDT)
Original-Received: by 10.36.28.200 with HTTP; Tue, 18 Oct 2016 08:45:47 -0700 (PDT)
In-Reply-To: <4d9aa487-c824-490a-ae3a-ac90e2a2db3d@isocpp.org>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 ville.voutilainen@gmail.com designates 2607:f8b0:4001:c06::236 as permitted
 sender) smtp.mailfrom=ville.voutilainen@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:28941
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/28941>

On 18 October 2016 at 18:36,  <mihailnajdenov@gmail.com> wrote:
>> release() doesn't change the object's lifetime for unique_ptr - it hands
>> the pointer back to you, still alive.
> Well, release() changes the lifetime to "live until program termination."

Depends on how the resource was acquired.

> The problem is, until now, only the memory managing pointers have this
> interface and this very interface already means something.
> If you see today reset (on a pointer), it means only one thing, be it std,
> Qt or any other smart pointer.

I can quite easily write such a deleter that reset() on a shared_ptr
and on a unique_ptr
will do exactly what observer_ptr's reset() does.

> observer changes this, overloads what reset means, all that for no good
> enough reason (by a long shot).

Well, reset() means what it always meant, it resets the handle to have
some other pointer or none.
The same logic applies to release(). As far as reasons go,
observer_ptr remains superior
to things like owner<T>, since it says nothing about ownership
semantics and is not a pointer.
The latter bit is the most useful characteristic of observer_ptr, and
while it has downsides for some
cases, that's a tolerable trade-off to make for quite many audiences.
The former bit is surprisingly
handy as well.

-- 
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 email 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/CAFk2RUZC6anr-MkMA37H3LKM235Uxh0Y6z58KyvRK-4h3R6%2BRw%40mail.gmail.com.

.
