Opened 12 years ago
Closed 11 years ago
#4493 closed Feature Requests (fixed)
shared_array lacks get_deleter method
Reported by: | Owned by: | Peter Dimov | |
---|---|---|---|
Milestone: | Boost 1.44.0 | Component: | smart_ptr |
Version: | Boost 1.44.0 | Severity: | Problem |
Keywords: | Cc: | r_q_einstein-boostbugs@… |
Description
shared_ptr has a get_deleter() method, which is very useful. shared_array does not have a get_deleter() method.
Since the deleter for a shared_array is passed to the constructor by value, there is no straightforward way* for the caller to get a pointer or reference to it. If the caller needs access to the deleter object's state or methods, which is entirely reasonable, the caller has no way to get it.
A get_deleter() method should be added to shared_array to meet this requirement and for consistency with the shared_ptr class.
*True, the caller can pass the deleter wrapped in a container object that holds a reference to the deleter, but that's a contortion that should not be necessary.
Change History (4)
comment:1 by , 12 years ago
Component: | array → smart_ptr |
---|---|
Owner: | changed from | to
comment:3 by , 11 years ago
Status: | new → assigned |
---|
comment:4 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
shared_array is part of the smart_ptr library, not Boost.Array.