From c48f05dcb40453fb1a2366d17be6c33e1ea7628c Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 16 Feb 2004 18:50:07 +0000 Subject: [PATCH] enable_shared_from_this is now const-tolerant. [SVN r22298] --- include/boost/enable_shared_from_this.hpp | 2 +- include/boost/shared_ptr.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 &)