Index: boost/shared_ptr.hpp =================================================================== --- boost/shared_ptr.hpp (revision 44144) +++ boost/shared_ptr.hpp (working copy) @@ -50,7 +50,7 @@ template class shared_ptr; template class weak_ptr; -template class enable_shared_from_this; +template class enable_shared_from_this_base; namespace detail { @@ -93,7 +93,7 @@ struct ignore_enable_shared_from_this_tag {}; -template void sp_enable_shared_from_this( boost::shared_ptr * ptr, boost::enable_shared_from_this const * pe ) +template void sp_enable_shared_from_this( boost::shared_ptr * ptr, boost::enable_shared_from_this_base const * pe ) { if(pe != 0) { Index: boost/enable_shared_from_this.hpp =================================================================== --- boost/enable_shared_from_this.hpp (revision 44144) +++ boost/enable_shared_from_this.hpp (working copy) @@ -21,7 +21,17 @@ namespace boost { +template struct enable_shared_from_this_base +{ + template + void _internal_accept_owner(shared_ptr &owner) const + { + static_cast(this)->_internal_accept_owner(owner); + } +}; + template class enable_shared_from_this +: public enable_shared_from_this_base< enable_shared_from_this > { // dynamic cast to template type doesn't work in constructor, so we have // to use lazy initialization