diff --git a/include/boost/enable_shared_from_this.hpp b/include/boost/enable_shared_from_this.hpp index d3f8ab8..affed6f 100644 --- a/include/boost/enable_shared_from_this.hpp +++ b/include/boost/enable_shared_from_this.hpp @@ -60,7 +60,7 @@ public: } typedef T _internal_element_type; // for bcc 5.5.1 - weak_ptr<_internal_element_type> _internal_weak_this; + mutable weak_ptr<_internal_element_type> _internal_weak_this; }; } // namespace boost diff --git a/include/boost/shared_ptr.hpp b/include/boost/shared_ptr.hpp index d4b44e6..a5e4adf 100644 --- a/include/boost/shared_ptr.hpp +++ b/include/boost/shared_ptr.hpp @@ -83,9 +83,9 @@ template<> struct shared_ptr_traits // enable_shared_from_this support -template void sp_enable_shared_from_this(boost::enable_shared_from_this * pe, Y * px, shared_count const & pn) +template void sp_enable_shared_from_this(boost::enable_shared_from_this const * pe, Y const * px, shared_count const & pn) { - if(pe != 0) pe->_internal_weak_this._internal_assign(px, pn); + if(pe != 0) pe->_internal_weak_this._internal_assign(const_cast(px), pn); } inline void sp_enable_shared_from_this(void const volatile *, void const volatile *, shared_count const &)