220 10515 <CAGg_6+OAfiWc_=eQh9nG==DrKWB=5yGAV8ER6mEiATSRmjF6eA@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Nevin Liber <nevin@eviloverlord.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: get_deleter_type_info
Date: Mon, 5 May 2014 12:42:13 -0500
Lines: 110
Approved: news@gmane.org
Message-ID: <CAGg_6+OAfiWc_=eQh9nG==DrKWB=5yGAV8ER6mEiATSRmjF6eA@mail.gmail.com>
References: <aad284b8-1af7-4aa9-aabe-f36ebfedf78f@isocpp.org>
 <2219117.8dN8m88Reg@tjmaciei-mobl4> <CA+VeAM2NCB4SaKEoOtsQRb39SQrYBjA4_jWEBhSC6yRbgZTzmw@mail.gmail.com>
 <CAGg_6+Oz9=wQupG_fFDKCskXh13BOoLE9E66M=x=jMVn-z9X0w@mail.gmail.com> <CAArVCkSoSC9eJ7hg-mZw2cOt+votAs+-emdA_kwk7w7C0USYLA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=f46d043c7ffe2fab0604f8aaa9a6
X-Trace: ger.gmane.org 1399405531 3018 80.91.229.3 (6 May 2014 19:45:31 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 6 May 2014 19:45:31 +0000 (UTC)
To: "std-proposals@isocpp.org" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCE35H5S6IDBBHU3T6NQKGQE4F3TEMQ@isocpp.org Tue May 06 21:45:24 2014
Return-path: <std-proposals+bncBCE35H5S6IDBBHU3T6NQKGQE4F3TEMQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wi0-f199.google.com ([209.85.212.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCE35H5S6IDBBHU3T6NQKGQE4F3TEMQ@isocpp.org>)
	id 1WhkH4-00085g-H5
	for gclcip-std-proposals@m.gmane.org; Tue, 06 May 2014 20:39:30 +0200
Original-Received: by mail-wi0-f199.google.com with SMTP id hm4sf19839wib.10
        for <gclcip-std-proposals@m.gmane.org>; Tue, 06 May 2014 11:39:30 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
         :date:message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=v6rmmaSlpKk6M0cDwYgffJqlg1jBd9VGoAiVZX6OKnc=;
        b=LwwbsV9Ll+dbTAEIkq7YB3szSScySd4IGXcK2p3T5YX3xEBlp1JFY1wK2p+OxxkyuR
         IG0KRCFzUr1L0o93ZfL5DrrGelvKDIkOz/Qv4loLtC+7dDgCooOzqhbVwgXMdeCwrm2O
         7xMAwqV4sYz+2S8MbsZ72DPKqjKms+ktS7rdot3TFVnHPMmd+Wmxq1jy2QjVPwh3QJIb
         ZWQwGD7hUhQs6Gs1kjJGRI3y33TVilq/BB54mTVJSkVZy47IIooSTCkLF/rZv2kFOgfi
         NzzhPBFxEspWxPlJo0WlMtArgg8DbkgSoprjIXriDG/ZRwao8i7VAI+0HAoEmaci9Ikn
         bdnQ==
X-Gm-Message-State: ALoCoQkT7Dri10YLvN4ZmRmYZ7/hSYZwsfz2jqd+xAgpzrvfmYEr8x4vEo6F8hFPc1AAAHKqcpZO
X-Received: by 10.180.211.102 with SMTP id nb6mr1640222wic.1.1399311825022;
        Mon, 05 May 2014 10:43:45 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.94.198 with SMTP id de6ls465133wib.21.canary; Mon, 05 May
 2014 10:42:53 -0700 (PDT)
X-Received: by 10.180.94.37 with SMTP id cz5mr17061439wib.19.1399311773842;
        Mon, 05 May 2014 10:42:53 -0700 (PDT)
Original-Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [2a00:1450:400c:c00::22e])
        by mx.google.com with ESMTPS id lj4si4571454wjc.134.2014.05.05.10.42.53
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Mon, 05 May 2014 10:42:53 -0700 (PDT)
Received-SPF: pass (google.com: domain of nliber@gmail.com designates 2a00:1450:400c:c00::22e as permitted sender) client-ip=2a00:1450:400c:c00::22e;
Original-Received: by mail-wg0-f46.google.com with SMTP id n12so5939905wgh.29
        for <std-proposals@isocpp.org>; Mon, 05 May 2014 10:42:53 -0700 (PDT)
X-Received: by 10.180.93.101 with SMTP id ct5mr16978546wib.23.1399311773442;
 Mon, 05 May 2014 10:42:53 -0700 (PDT)
Original-Sender: nliber@gmail.com
Original-Received: by 10.194.121.165 with HTTP; Mon, 5 May 2014 10:42:13 -0700 (PDT)
In-Reply-To: <CAArVCkSoSC9eJ7hg-mZw2cOt+votAs+-emdA_kwk7w7C0USYLA@mail.gmail.com>
X-Original-Sender: nevin@eviloverlord.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of nliber@gmail.com designates 2a00:1450:400c:c00::22e as permitted
 sender) smtp.mail=nliber@gmail.com;       dkim=pass header.i=@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: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:10515
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/10515>

--f46d043c7ffe2fab0604f8aaa9a6
Content-Type: text/plain; charset=UTF-8

On 5 May 2014 12:27, Philipp Maximilian Stephani <p.stephani2@gmail.com>wrote:

>
>
> On Mon May 05 2014 at 17:07:35, Nevin Liber <nevin@eviloverlord.com>
> wrote:
>
>> On 5 May 2014 02:37, Matthew Fletcher <0xc0deface@gmail.com> wrote:
>>
>>> The use case where I am having problems is with serialisation of
>>> shared_ptr.
>>>
>>
>> Just serializing the deleter isn't sufficient; for correctness you also
>> need to serialize the allocation method (both the object and the deleter
>> may be dependent upon it), which isn't directly stored with the shared_ptr.
>>
>>
> The allocator is used to deallocate the control block, so I think it needs
> to be stored as well.
>

When a custom deleter is being used (the OP case), the shared_ptr has no
idea where the allocation comes from, because all that is passed to its
constructor is a raw pointer.
-- 
 Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  (847) 691-1404

-- 

--- 
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--f46d043c7ffe2fab0604f8aaa9a6
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On 5 May 2014 12:27, Philipp Maximilian Stephani <span dir=
=3D"ltr">&lt;<a href=3D"mailto:p.stephani2@gmail.com" target=3D"_blank">p.s=
tephani2@gmail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div=
 class=3D"gmail_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-style:solid;p=
adding-left:1ex"><div class=3D""><br><br><div>On Mon May 05 2014 at 17:07:3=
5, Nevin Liber &lt;<a href=3D"mailto:nevin@eviloverlord.com" target=3D"_bla=
nk">nevin@eviloverlord.com</a>&gt; wrote:</div>

<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;p=
adding-left:1ex">
<div dir=3D"ltr">On 5 May 2014 02:37, Matthew Fletcher <span dir=3D"ltr">&l=
t;<a href=3D"mailto:0xc0deface@gmail.com" target=3D"_blank">0xc0deface@gmai=
l.com</a>&gt;</span> wrote:<br></div><div class=3D"gmail_extra"><div class=
=3D"gmail_quote">


<div dir=3D"ltr">

<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;p=
adding-left:1ex"><div dir=3D"ltr"><div>The use case where I am having probl=
ems is with serialisation of shared_ptr.</div>

</div></blockquote>


<div><br></div></div></div></div><div class=3D"gmail_extra"><div class=3D"g=
mail_quote"><div dir=3D"ltr"><div>Just serializing the deleter isn&#39;t su=
fficient; for correctness you also need to serialize the allocation method =
(both the object and the deleter may be dependent upon it), which isn&#39;t=
 directly stored with the shared_ptr.</div>


</div></div></div><br></blockquote><div><br></div></div><div>The allocator =
is used to deallocate the control block, so I think it needs to be stored a=
s well.</div></blockquote><div><br></div><div>When a custom deleter is bein=
g used (the OP case), the shared_ptr has no idea where the allocation comes=
 from, because all that is passed to its constructor is a raw pointer.</div=
>

</div>-- <br>=C2=A0Nevin &quot;:-)&quot; Liber=C2=A0 &lt;mailto:<a href=3D"=
mailto:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.com</a>=
&gt;=C2=A0 (847) 691-1404
</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 />

--f46d043c7ffe2fab0604f8aaa9a6--

.
