Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5381: get_deleter<D>(ptr) needs D to be exactly known
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-04-06 21:32:50
#5381: get_deleter<D>(ptr) needs D to be exactly known
----------------------------------------+-----------------------------------
Reporter: christian.kotz@⦠| Owner: pdimov
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: smart_ptr
Version: Boost 1.45.0 | Severity: Problem
Resolution: | Keywords:
----------------------------------------+-----------------------------------
Comment (by steven_watanabe):
Replying to [ticket:5381 christian.kotz@â¦]:
> get_deleter<Base_of_D>(ptr) returns 0.
>
> This makes efficient polymorphous COW pointer implementations internally
based on shared_pointer inefficient, because it is not possible to have
reference count (deleter) and pointee allocated in one memory block, as is
done in boost:::make_shared. Note, COW pointer need access to the deleter
for the clone function at a time later than the constructor.
I don't understand. If you want to make something like make_shared, you
should only need to access the deleter when you're constructing the
object. At this point, you need to know the exact type of the deleter
anyway. Actually, though, I don't see what you want to do that can't be
handled by just using make_shared.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5381#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC