Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81860 - in trunk/boost/smart_ptr: . detail
From: pdimov_at_[hidden]
Date: 2012-12-11 13:21:32


Author: pdimov
Date: 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
New Revision: 81860
URL: http://svn.boost.org/trac/boost/changeset/81860

Log:
Change make_shared to use the new _internal_get_untyped_deleter. Refs #6830.
Text files modified:
   trunk/boost/smart_ptr/detail/shared_count.hpp | 5 ++
   trunk/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_aix.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_nt.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_pt.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_solaris.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_spin.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_sync.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_base_w32.hpp | 1
   trunk/boost/smart_ptr/detail/sp_counted_impl.hpp | 15 ++++++
   trunk/boost/smart_ptr/make_shared_object.hpp | 97 +++++++++++++++++++++++----------------
   trunk/boost/smart_ptr/shared_ptr.hpp | 27 +++++++---
   21 files changed, 112 insertions(+), 49 deletions(-)

Modified: trunk/boost/smart_ptr/detail/shared_count.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/shared_count.hpp (original)
+++ trunk/boost/smart_ptr/detail/shared_count.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -447,6 +447,11 @@
     {
         return pi_? pi_->get_deleter( ti ): 0;
     }
+
+ void * get_untyped_deleter() const
+ {
+ return pi_? pi_->get_untyped_deleter(): 0;
+ }
 };
 
 

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -104,6 +104,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_aix.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_aix.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_aix.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -96,6 +96,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -124,6 +124,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -112,6 +112,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -111,6 +111,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -135,6 +135,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -135,6 +135,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -120,6 +120,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -127,6 +127,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_nt.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_nt.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_nt.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -59,6 +59,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_pt.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_pt.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_pt.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -70,6 +70,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -115,6 +115,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_solaris.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_solaris.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_solaris.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -62,6 +62,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_spin.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_spin.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_spin.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -84,6 +84,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_sync.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_sync.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_sync.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -109,6 +109,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -104,6 +104,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_base_w32.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_base_w32.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_base_w32.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -67,6 +67,7 @@
     }
 
     virtual void * get_deleter( sp_typeinfo const & ti ) = 0;
+ virtual void * get_untyped_deleter() = 0;
 
     void add_ref_copy()
     {

Modified: trunk/boost/smart_ptr/detail/sp_counted_impl.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/sp_counted_impl.hpp (original)
+++ trunk/boost/smart_ptr/detail/sp_counted_impl.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -83,6 +83,11 @@
         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 @@
         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 )
@@ -226,6 +236,11 @@
     {
         return ti == BOOST_SP_TYPEID( D )? &reinterpret_cast<char&>( d_ ): 0;
     }
+
+ virtual void * get_untyped_deleter()
+ {
+ return &reinterpret_cast<char&>( d_ );
+ }
 };
 
 #ifdef __CODEGUARD__

Modified: trunk/boost/smart_ptr/make_shared_object.hpp
==============================================================================
--- trunk/boost/smart_ptr/make_shared_object.hpp (original)
+++ trunk/boost/smart_ptr/make_shared_object.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -135,7 +135,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -148,11 +148,28 @@
     return boost::shared_ptr< T >( pt, pt2 );
 }
 
+template< class T > typename boost::detail::sp_if_not_array< T >::type make_shared_noinit()
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
+
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
+
+ void * pv = pd->address();
+
+ ::new( pv ) T;
+ pd->set_initialized();
+
+ T * pt2 = static_cast< T* >( pv );
+
+ boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+ return boost::shared_ptr< T >( pt, pt2 );
+}
+
 template< class T, class A > typename boost::detail::sp_if_not_array< T >::type allocate_shared( A const & a )
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -173,7 +190,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -190,7 +207,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -212,7 +229,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -233,7 +250,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -254,7 +271,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -276,7 +293,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -298,7 +315,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -321,7 +338,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -344,7 +361,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -368,7 +385,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -392,7 +409,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -417,7 +434,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -442,7 +459,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -468,7 +485,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -494,7 +511,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -521,7 +538,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -548,7 +565,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -576,7 +593,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -604,7 +621,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -633,7 +650,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -666,7 +683,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -684,7 +701,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -702,7 +719,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -720,7 +737,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -738,7 +755,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -756,7 +773,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -774,7 +791,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -792,7 +809,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -810,7 +827,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -828,7 +845,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -846,7 +863,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -864,7 +881,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -882,7 +899,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -900,7 +917,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -918,7 +935,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -936,7 +953,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -954,7 +971,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 
@@ -972,7 +989,7 @@
 {
     boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
- boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+ boost::detail::sp_ms_deleter< T > * pd = static_cast<boost::detail::sp_ms_deleter< T > *>( pt._internal_get_untyped_deleter() );
 
     void * pv = pd->address();
 

Modified: trunk/boost/smart_ptr/shared_ptr.hpp
==============================================================================
--- trunk/boost/smart_ptr/shared_ptr.hpp (original)
+++ trunk/boost/smart_ptr/shared_ptr.hpp 2012-12-11 13:21:29 EST (Tue, 11 Dec 2012)
@@ -696,11 +696,16 @@
         return pn < rhs.pn;
     }
 
- void * _internal_get_deleter( boost::detail::sp_typeinfo const & ti ) const
+ void * _internal_get_deleter( boost::detail::sp_typeinfo const & ti ) const BOOST_NOEXCEPT
     {
         return pn.get_deleter( ti );
     }
 
+ void * _internal_get_untyped_deleter() const BOOST_NOEXCEPT
+ {
+ return pn.get_untyped_deleter();
+ }
+
     bool _internal_equiv( shared_ptr const & r ) const BOOST_NOEXCEPT
     {
         return px == r.px && pn == r.pn;
@@ -881,9 +886,9 @@
 
 #else
 
-template<class D, class T> D * basic_get_deleter(shared_ptr<T> const & p)
+template<class D, class T> D * basic_get_deleter( shared_ptr<T> const & p ) BOOST_NOEXCEPT
 {
- return static_cast<D *>(p._internal_get_deleter(BOOST_SP_TYPEID(D)));
+ return static_cast<D *>( p._internal_get_deleter(BOOST_SP_TYPEID(D)) );
 }
 
 #endif
@@ -904,11 +909,13 @@
     {
         deleter_ = deleter;
     }
- template<typename D> D* get_deleter() const
+
+ template<typename D> D* get_deleter() const BOOST_NOEXCEPT
     {
- return boost::detail::basic_get_deleter<D>(deleter_);
+ return boost::detail::basic_get_deleter<D>( deleter_ );
     }
- template< class T> void operator()( T* )
+
+ template< class T> void operator()( T* )
     {
         BOOST_ASSERT( deleter_.use_count() <= 1 );
         deleter_.reset();
@@ -917,17 +924,19 @@
 
 } // namespace detail
 
-template<class D, class T> D * get_deleter(shared_ptr<T> const & p)
+template<class D, class T> D * get_deleter( shared_ptr<T> const & p ) BOOST_NOEXCEPT
 {
     D *del = boost::detail::basic_get_deleter<D>(p);
- if(del == 0)
+
+ if(del == 0)
     {
         boost::detail::esft2_deleter_wrapper *del_wrapper = boost::detail::basic_get_deleter<boost::detail::esft2_deleter_wrapper>(p);
 // The following get_deleter method call is fully qualified because
 // older versions of gcc (2.95, 3.2.3) fail to compile it when written del_wrapper->get_deleter<D>()
         if(del_wrapper) del = del_wrapper->::boost::detail::esft2_deleter_wrapper::get_deleter<D>();
     }
- return del;
+
+ return del;
 }
 
 // atomic access


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk