Subject: Re: [boost] [function] "paranoia" vs efficiency
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2009-11-09 09:48:35
Domagoj Saric wrote:
> "Stewart, Robert" <Robert.Stewart_at_[hidden]> wrote
> > As soon as you specialize the class template with anything other
> > than the default deleter type, you have a different type.
> > shared_ptr<T>
> > is shared_ptr<T>, even if they use different deleters. your_ptr<T>
> > isn't your_ptr<T,other_deleter>.
> yes it is, if "other_deleter" is in fact the default
> "dynamic_deleter" class
> that is again in fact only a wrapper around an actual dynamc
> deleter (>just
> like the current boost::detail::sp_counted_impl_pd<> class
> is< as said in my
> previous post)...
That's a big "if." The point is, your_ptr<T> is not the same as shared_ptr<T>. If you want a class with a potentially different deleter type, create one, document it, and submit it to Boost. The value of shared_ptr<T> is that all shared_ptr<T>'s have the same deleter type, so they are always compatible.
Perhaps Peter would be willing to implement shared_ptr<T> as deriving from your_ptr<T,dynamic_deleter> in order to share code, but shared_ptr<T> shouldn't be changed to allow parameterizing the deleter type.
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com
IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk