Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81899 - in branches/release: . boost boost/smart_ptr boost/smart_ptr/detail
From: pdimov_at_[hidden]
Date: 2012-12-13 09:57:15


Author: pdimov
Date: 2012-12-13 09:57:12 EST (Thu, 13 Dec 2012)
New Revision: 81899
URL: http://svn.boost.org/trac/boost/changeset/81899

Log:
Merged revision(s) 81860-81861 from trunk:
Change make_shared to use the new _internal_get_untyped_deleter. Fixes #6830.
........
Add allocate_shared_noinit.
........

Properties modified:
   branches/release/ (props changed)
   branches/release/boost/ (props changed)
   branches/release/boost/smart_ptr/ (props changed)
Text files modified:
   branches/release/boost/smart_ptr/detail/shared_count.hpp | 5 +
   branches/release/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_aix.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_nt.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_pt.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_solaris.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_spin.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_sync.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_base_w32.hpp | 1
   branches/release/boost/smart_ptr/detail/sp_counted_impl.hpp | 15 +++++
   branches/release/boost/smart_ptr/make_shared_object.hpp | 114 +++++++++++++++++++++++++--------------
   branches/release/boost/smart_ptr/shared_ptr.hpp | 27 ++++++---
   21 files changed, 129 insertions(+), 49 deletions(-)

Modified: branches/release/boost/smart_ptr/detail/shared_count.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/shared_count.hpp (original)
+++ branches/release/boost/smart_ptr/detail/shared_count.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_aix.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_aix.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_aix.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_cw_x86.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_nt.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_nt.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_nt.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_pt.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_pt.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_pt.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_solaris.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_solaris.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_solaris.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_spin.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_spin.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_spin.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_sync.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_sync.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_sync.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_base_w32.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_base_w32.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_base_w32.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/detail/sp_counted_impl.hpp
==============================================================================
--- branches/release/boost/smart_ptr/detail/sp_counted_impl.hpp (original)
+++ branches/release/boost/smart_ptr/detail/sp_counted_impl.hpp 2012-12-13 09:57:12 EST (Thu, 13 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: branches/release/boost/smart_ptr/make_shared_object.hpp
==============================================================================
--- branches/release/boost/smart_ptr/make_shared_object.hpp (original)
+++ branches/release/boost/smart_ptr/make_shared_object.hpp 2012-12-13 09:57:12 EST (Thu, 13 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();
 
@@ -165,6 +182,23 @@
     return boost::shared_ptr< T >( pt, pt2 );
 }
 
+template< class T, class A > typename boost::detail::sp_if_not_array< T >::type allocate_shared_noinit( A const & a )
+{
+ boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
+
+ 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 );
+}
+
 #if defined( BOOST_HAS_VARIADIC_TMPL ) && defined( BOOST_HAS_RVALUE_REFS )
 
 // Variadic templates, rvalue reference
@@ -173,7 +207,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 +224,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 +246,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 +267,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 +288,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 +310,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 +332,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 +355,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 +378,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 +402,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 +426,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 +451,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 +476,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 +502,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 +528,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 +555,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 +582,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 +610,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 +638,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 +667,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 +700,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 +718,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 +736,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 +754,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 +772,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 +790,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 +808,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 +826,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 +844,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 +862,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 +880,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 +898,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 +916,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 +934,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 +952,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 +970,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 +988,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 +1006,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: branches/release/boost/smart_ptr/shared_ptr.hpp
==============================================================================
--- branches/release/boost/smart_ptr/shared_ptr.hpp (original)
+++ branches/release/boost/smart_ptr/shared_ptr.hpp 2012-12-13 09:57:12 EST (Thu, 13 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 = detail::basic_get_deleter<D>(p);
- if(del == 0)
+
+ if(del == 0)
     {
         detail::esft2_deleter_wrapper *del_wrapper = detail::basic_get_deleter<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