summaryrefslogtreecommitdiff
path: root/boost/smart_ptr/detail/sp_counted_impl.hpp
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
committerChanho Park <chanho61.park@samsung.com>2014-12-11 18:55:56 +0900
commit08c1e93fa36a49f49325a07fe91ff92c964c2b6c (patch)
tree7a7053ceb8874b28ec4b868d4c49b500008a102e /boost/smart_ptr/detail/sp_counted_impl.hpp
parentbb4dd8289b351fae6b55e303f189127a394a1edd (diff)
downloadboost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.gz
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.bz2
boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.zip
Imported Upstream version 1.57.0upstream/1.57.0
Diffstat (limited to 'boost/smart_ptr/detail/sp_counted_impl.hpp')
-rw-r--r--boost/smart_ptr/detail/sp_counted_impl.hpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/boost/smart_ptr/detail/sp_counted_impl.hpp b/boost/smart_ptr/detail/sp_counted_impl.hpp
index aab39bdd03..a7b43aeaff 100644
--- a/boost/smart_ptr/detail/sp_counted_impl.hpp
+++ b/boost/smart_ptr/detail/sp_counted_impl.hpp
@@ -83,6 +83,11 @@ public:
return 0;
}
+ virtual void * get_untyped_deleter()
+ {
+ return 0;
+ }
+
#if defined(BOOST_SP_USE_STD_ALLOCATOR)
void * operator new( std::size_t )
@@ -153,6 +158,11 @@ public:
return ti == BOOST_SP_TYPEID(D)? &reinterpret_cast<char&>( del ): 0;
}
+ virtual void * get_untyped_deleter()
+ {
+ return &reinterpret_cast<char&>( del );
+ }
+
#if defined(BOOST_SP_USE_STD_ALLOCATOR)
void * operator new( std::size_t )
@@ -203,7 +213,7 @@ public:
{
}
- sp_counted_impl_pda( P p, A a ): p_( p ), d_(), a_( a )
+ sp_counted_impl_pda( P p, A a ): p_( p ), d_( a ), a_( a )
{
}
@@ -214,11 +224,28 @@ public:
virtual void destroy() // nothrow
{
+#if !defined( BOOST_NO_CXX11_ALLOCATOR )
+
+ typedef typename std::allocator_traits<A>::template rebind_alloc< this_type > A2;
+
+#else
+
typedef typename A::template rebind< this_type >::other A2;
+#endif
+
A2 a2( a_ );
+#if !defined( BOOST_NO_CXX11_ALLOCATOR )
+
+ std::allocator_traits<A2>::destroy( a2, this );
+
+#else
+
this->~this_type();
+
+#endif
+
a2.deallocate( this, 1 );
}
@@ -226,6 +253,11 @@ public:
{
return ti == BOOST_SP_TYPEID( D )? &reinterpret_cast<char&>( d_ ): 0;
}
+
+ virtual void * get_untyped_deleter()
+ {
+ return &reinterpret_cast<char&>( d_ );
+ }
};
#ifdef __CODEGUARD__