220 28938 <CAFk2RUatxD=B9-_P5yBRBrHqFvj123v6BQ=QFRpe9UNMGWH4Gw@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 16:57:56 +0300
Lines: 22
Approved: news@gmane.org
Message-ID: <CAFk2RUatxD=B9-_P5yBRBrHqFvj123v6BQ=QFRpe9UNMGWH4Gw@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>
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 1476799112 4000 195.159.176.226 (18 Oct 2016 13:58:32 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 18 Oct 2016 13:58:32 +0000 (UTC)
To: "ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC5JHI7A7ALRBZOUTDAAKGQEJGKMS2A@isocpp.org Tue Oct 18 15:58:28 2016
Return-path: <std-proposals+bncBC5JHI7A7ALRBZOUTDAAKGQEJGKMS2A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-it0-f70.google.com ([209.85.214.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBZOUTDAAKGQEJGKMS2A@isocpp.org>)
	id 1bwUtw-0005Ji-AF
	for gclcip-std-proposals@m.gmane.org; Tue, 18 Oct 2016 15:57:56 +0200
Original-Received: by mail-it0-f70.google.com with SMTP id w141sf119970503itc.3
        for <gclcip-std-proposals@m.gmane.org>; Tue, 18 Oct 2016 06:57:58 -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=t+R8byaEuwZLmCweUl+T8IyvVZ9WpFErnldtVfow2KQ=;
        b=Mh2o9bzcBf1tsww53MS8v0B8MGa1Z6h5Lz4/Z6IWunz8xaC49Jcn6hPxPZI3YtmnX0
         tIcTpOWoehmUv9rAikZ6aE5VPA5rHmVeEi+GVWRZxaNj3cW1upNvO/JtHdH9HNDdnxbn
         OJIJVFzPcR5ypli9mkcCYRo3HjrUwtNySgcsvF3drwhjIEpfQ4ENHNCJm8p1ak7J6Tm8
         Zlqh0a94HrW55FQrKNg9zpqS0xHmLlZM0uahn45P/Nl4GNvbsgWy8RE1hEwZjUkuQ34g
         LIPx0Xrw0B9uqGQK60yxEdR/+wfKBaFMhquZwbBT3l5PmT9zFnB026l3Py2V+a30BAsy
         WJrA==
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=t+R8byaEuwZLmCweUl+T8IyvVZ9WpFErnldtVfow2KQ=;
        b=ecsfXnsnSTwDVpV1HRlAL7FWhS3x0fgHFUnHs7P4TVc+VDZ+GFSp5GrgPEXEZAB5Vq
         3ubYWXcrmQ4ekpI1V63VAwaVyGFSL568d9+EEqmIUAEcXNw/Sc7wTGdv6axav+l5M4ps
         SWpsd686BUzHIZ1klgxXbtZJX0akGk9cbhnEl70LfO0VCPOTIwdjswNr3PLYXnooD4dt
         cnamEMpRFEDzLlWySXJO97WeIpto/DZUWthm5NZogwvqoFpOYYMjG4WXJ6T5bHV1+3IM
         tCkziFWgVGYIlqbrOljHwRwjVVN24FeIZtkNS30j9s8TsQQPRBLPNbC5tta2wFRVbxuH
         UDKQ==
X-Gm-Message-State: AA6/9Rl9dnMAp5mTrekG6BXyLvm8yFOAJDf5/GGkfmv4n8B1iEzDXCugxLZzDw9ehhG/tw==
X-Received: by 10.107.146.9 with SMTP id u9mr343087iod.66.1476799078287;
        Tue, 18 Oct 2016 06:57:58 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.230.3 with SMTP id e3ls3323017ith.7.gmail; Tue, 18 Oct 2016
 06:57:57 -0700 (PDT)
X-Received: by 10.107.43.75 with SMTP id r72mr1216617ior.26.1476799077219;
        Tue, 18 Oct 2016 06:57:57 -0700 (PDT)
Original-Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com. [2607:f8b0:4001:c0b::22d])
        by mx.google.com with ESMTPS id m184si1850782itd.81.2016.10.18.06.57.57
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 18 Oct 2016 06:57:57 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:4001:c0b::22d as permitted sender) client-ip=2607:f8b0:4001:c0b::22d;
Original-Received: by mail-it0-x22d.google.com with SMTP id m138so80774601itm.0
        for <std-proposals@isocpp.org>; Tue, 18 Oct 2016 06:57:57 -0700 (PDT)
X-Received: by 10.36.144.68 with SMTP id x65mr13388737itd.12.1476799076847;
 Tue, 18 Oct 2016 06:57:56 -0700 (PDT)
Original-Received: by 10.36.28.200 with HTTP; Tue, 18 Oct 2016 06:57:56 -0700 (PDT)
In-Reply-To: <f3d2848e-56f7-4ddd-a0a0-1a8c7b8db391@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:c0b::22d 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:28938
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/28938>

On 18 October 2016 at 16:44,  <mihailnajdenov@gmail.com> wrote:
> is this safe?
>
> p.reset(new int{});
>
> Right now - yes!, with any smart pointer.

No, because you have now given your shared_ptr an object with a
default deleter, which might
not be what your program expected. You have also decreased the
reference count of the original
object, which might again not be what your program expected.

It might not be safe for a unique_ptr either, depending on what your
deleter type is.

-- 
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/CAFk2RUatxD%3DB9-_P5yBRBrHqFvj123v6BQ%3DQFRpe9UNMGWH4Gw%40mail.gmail.com.

.
