From 028bb2cee86d5aea931bb4b928a54f70ace6a565 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 20 Jun 2017 19:33:39 +0300 Subject: [PATCH] Fix get_deleter in allocate_shared_array.hpp --- .../boost/smart_ptr/allocate_shared_array.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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() {