220 28943 <080a6163-4350-4246-a2d6-a3ae7f6db473@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: mihailnajdenov@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 09:33:27 -0700 (PDT)
Lines: 108
Approved: news@gmane.org
Message-ID: <080a6163-4350-4246-a2d6-a3ae7f6db473@isocpp.org>
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>
 <CAFk2RUZC6anr-MkMA37H3LKM235Uxh0Y6z58KyvRK-4h3R6+Rw@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1231_1554030472.1476808407629"
X-Trace: blaine.gmane.org 1476808435 15174 195.159.176.226 (18 Oct 2016 16:33:55 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 18 Oct 2016 16:33:55 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCUJ3A7GRAPRBWM5THAAKGQEF7N3XFA@isocpp.org Tue Oct 18 18:33:45 2016
Return-path: <std-proposals+bncBCUJ3A7GRAPRBWM5THAAKGQEF7N3XFA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f199.google.com ([209.85.220.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCUJ3A7GRAPRBWM5THAAKGQEF7N3XFA@isocpp.org>)
	id 1bwXKV-0001eT-0V
	for gclcip-std-proposals@m.gmane.org; Tue, 18 Oct 2016 18:33:31 +0200
Original-Received: by mail-qk0-f199.google.com with SMTP id n189sf144912579qke.0
        for <gclcip-std-proposals@m.gmane.org>; Tue, 18 Oct 2016 09:33:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=K3Q/nMVYLmgCx7PGwJyEv08vwZVt/lr6Z3pY677lTWY=;
        b=M51ml0cKoLwK+T1hkxK1byyBRJ2t2KPcrjvOH+XnQd1SIH9LWVFxWVNF+04YGe/+FN
         tP9H/VwcLVKz2XfBNF9SqOpwoVhfvBmC13b+TgJN0p45fZJQAIE5qbQjqmB0vylfqbqP
         KkVNQuG5DgDjpPcqciGB3uTBlpWgW5q/0ycj5+XZhPa615Fh7lFvGRttfUee/RDS0sbn
         Vekp8slOWjGcYDAqhzypu5/4XUzcKbsCmYfvGsKcIn4kzur6pXcxLzZE6exU2uI6nlnp
         VTATmK703aB2N1CjMfVpzNI0yo6Srkyr/G+HITX+rdcmtoAdFfWpFb00Bo4PtPnutrMP
         Ad6w==
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
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=K3Q/nMVYLmgCx7PGwJyEv08vwZVt/lr6Z3pY677lTWY=;
        b=Vh8TMbFP4jMGJRF/EzoES4JfvM7Yg9I+6W8JvL7kgbA8UT1rfjtODLL+8GZs5sMI2w
         /N/VKeDzg0cOfpcwAZ8jlFptCpmi6+GXMMmO3c52+pcdiC9mK2tvBaJ+sPR7u2kXgEvA
         9lc9MyhMZ3PcPJvBq4sFKXG99BI6iLiM4+oKV2niLU6kyU5uJK+BMyk83Z6/BDtpTDow
         GmbjznfALy5Bb6UicIALLS3S4frgmKhMIpv+lYOtN5oqR66uQeTAstI5PUM4FU2PmtSD
         H/GID9PX06ztJhnldR08CFDyim/J71l9sI2tE6SVcsEteORP9y8mOFZ3IxAvlfycVK3g
         8l6g==
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:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=K3Q/nMVYLmgCx7PGwJyEv08vwZVt/lr6Z3pY677lTWY=;
        b=lEjVJzp2ahP9Vc2qVGh7vMrfW0PG47e5s6iWIV/vSo8a/MnUjE6KSIFFdzqPrRBHm1
         QOQUdaAYX/1SsLacILVnI8R/1PF/5pQWwKYcT6qDOqXdN35jPc6ylJe5MnnKfhdA79W5
         BFDqtUhS5In6ITJk5tj2csD5wQOIT1lynZTTqiWXpNyHE5q9ECuTIjBy1KE576WKt9D0
         5bgv44h0mmRrmt2iMRPFEWtZ1GS28Vr+t5gj6H2jZvw1OXQhu6YO4kdspDtXYzOjUysz
         hYzsYIzbKBjYf+fbqIuCQ+t2V4yvT6aXt0WTac9Gaeb2bOMQ7myBfeD6D4FXbsShUnv1
         X/RA==
X-Gm-Message-State: AA6/9RmmjDEVTw3QnKKGns/WcEfCQaYn9ZOAamCCjJbId6rmlw07+ujiV26hAZwy5tTEJw==
X-Received: by 10.200.42.12 with SMTP id k12mr433845qtk.78.1476808413122;
        Tue, 18 Oct 2016 09:33:33 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.14.81 with SMTP id 78ls88089ioo.15.gmail; Tue, 18 Oct 2016
 09:33:29 -0700 (PDT)
X-Received: by 10.36.253.75 with SMTP id m72mr197390ith.9.1476808409361;
        Tue, 18 Oct 2016 09:33:29 -0700 (PDT)
In-Reply-To: <CAFk2RUZC6anr-MkMA37H3LKM235Uxh0Y6z58KyvRK-4h3R6+Rw@mail.gmail.com>
X-Original-Sender: MihailNajdenov@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:28943
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/28943>

------=_Part_1231_1554030472.1476808407629
Content-Type: multipart/alternative; 
	boundary="----=_Part_1232_1924318238.1476808407629"

------=_Part_1232_1924318238.1476808407629
Content-Type: text/plain; charset=UTF-8



On Tuesday, October 18, 2016 at 6:45:50 PM UTC+3, Ville Voutilainen wrote:
>
>
> > 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. 
>

It was never just about the handle,* it was always about the object 
lifetime.*

Let me point of the irony here.

We can have unique_ptr to consume a row pointer just with assignment - we 
have overloading for that.
But we don't do it. We invent a function.
This function is called reset
It is there to state intend. 
It is there to say, "take this object and manage it for me, you are the 
owner now".
And from this point onwards, every well behaved smart pointer library uses 
this idiom.
You can read 10+ years old code and reset will be there, saying the same 
thing.

Now comes a pointer which stops obeying this idiom. 
It starts using reset() as operator= 
From this point onwards when encountering reset (on a pointer) is code is 
ambiguous - 
"Does it transfer or does it not? Better dig out the definition of the 
pointer?"

So we invited ourselves the reverse problem reset() solved decades ago. 

*Where before we prevented the ambiguity of operator=(T*).*
*Now we introduce ambiguity in reset().* 

All this for a dumb pointer trying to be smart.

-- 
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/080a6163-4350-4246-a2d6-a3ae7f6db473%40isocpp.org.

------=_Part_1232_1924318238.1476808407629
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Tuesday, October 18, 2016 at 6:45:50 PM UTC+3, =
Ville Voutilainen wrote:<blockquote class=3D"gmail_quote" style=3D"margin: =
0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><br>&g=
t; observer changes this, overloads what reset means, all that for no good
<br>&gt; enough reason (by a long shot).
<br>
<br>Well, reset() means what it always meant, it resets the handle to have
<br>some other pointer or none.
<br></blockquote><div><br></div><div>It was never just about the handle,<b>=
 it was always about the object lifetime.</b></div><div><br></div><div>Let =
me point of the irony here.</div><div><br></div><div>We can have unique_ptr=
 to consume a row pointer just with assignment - we have overloading for th=
at.</div><div>But we don&#39;t do it. We invent a function.</div><div>This =
function is called reset</div><div>It is there to state intend. </div><div>=
It is there to say, &quot;take this object and manage it for me, you are th=
e owner now&quot;.</div><div>And from this point onwards, every well behave=
d smart pointer library uses this idiom.</div><div>You can read 10+ years o=
ld code and reset will be there, saying the same thing.</div><div><br></div=
><div>Now comes a pointer which stops obeying this idiom. </div><div>It sta=
rts using reset() as operator=3D </div><div>From this point onwards when en=
countering reset (on a pointer)=C2=A0is code is ambiguous - </div><div>&quo=
t;Does it transfer or does it not? Better dig out=C2=A0the definition of th=
e pointer?&quot;</div><div><br></div><div>So we invited ourselves the rever=
se problem reset() solved decades ago. </div><div><br></div><div><i>Where b=
efore=C2=A0we prevented=C2=A0the ambiguity of operator=3D(T*).</i></div><di=
v><i>Now we introduce ambiguity in reset().</i> </div><div><br></div><div>A=
ll this for a dumb pointer trying to be smart.</div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/080a6163-4350-4246-a2d6-a3ae7f6db473%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/080a6163-4350-4246-a2d6-a3ae7f6db473=
%40isocpp.org</a>.<br />

------=_Part_1232_1924318238.1476808407629--

------=_Part_1231_1554030472.1476808407629--

.
