diff --git a/include/boost/smart_ptr/allocate_shared_array.hpp b/include/boost/smart_ptr/allocate_shared_array.hpp index 636340c..b9c4ce4 100644 --- a/include/boost/smart_ptr/allocate_shared_array.hpp +++ b/include/boost/smart_ptr/allocate_shared_array.hpp @@ -762,8 +762,8 @@ public: allocator.deallocate(this, 1); } - void* get_deleter(const sp_typeinfo&) { - return &reinterpret_cast(deleter_); + void* get_deleter(const sp_typeinfo& ti) { + return ti == BOOST_SP_TYPEID(deleter_type)? &reinterpret_cast(deleter_): 0; } void* get_untyped_deleter() { @@ -803,8 +803,8 @@ public: allocator.deallocate(this, 1); } - void* get_deleter(const sp_typeinfo&) { - return &reinterpret_cast(deleter_); + void* get_deleter(const sp_typeinfo& ti) { + return ti == BOOST_SP_TYPEID(deleter_type)? &reinterpret_cast(deleter_): 0; } void* get_untyped_deleter() { @@ -849,8 +849,8 @@ public: allocator.deallocate(this, 1); } - void* get_deleter(const sp_typeinfo&) { - return &reinterpret_cast(deleter_); + void* get_deleter(const sp_typeinfo& ti) { + return ti == BOOST_SP_TYPEID(deleter_type)? &reinterpret_cast(deleter_): 0; } void* get_untyped_deleter() { @@ -894,8 +894,8 @@ public: allocator.deallocate(this, 1); } - void* get_deleter(const sp_typeinfo&) { - return &reinterpret_cast(deleter_); + void* get_deleter(const sp_typeinfo& ti) { + return ti == BOOST_SP_TYPEID(deleter_type)? &reinterpret_cast(deleter_): 0; } void* get_untyped_deleter() {