diff --git a/include/boost/smart_ptr/enable_shared_from_raw.hpp b/include/boost/smart_ptr/enable_shared_from_raw.hpp index f659c04..1911c07 100644 --- a/include/boost/smart_ptr/enable_shared_from_raw.hpp +++ b/include/boost/smart_ptr/enable_shared_from_raw.hpp @@ -4,7 +4,7 @@ // // enable_shared_from_raw.hpp // -// Copyright 2002, 2009 Peter Dimov +// Copyright 2002, 2009, 2014 Peter Dimov // Copyright 2008-2009 Frank Mori Hess // // Distributed under the Boost Software License, Version 1.0. @@ -72,16 +72,15 @@ private: template< class X, class Y > friend inline void detail::sp_enable_shared_from_this( boost::shared_ptr * ppx, Y const * py, boost::enable_shared_from_raw const * pe ); #endif - shared_ptr shared_from_this() + shared_ptr shared_from_this() const { init_weak_once(); - return shared_ptr( weak_this_ ); + return shared_ptr( weak_this_ ); } - shared_ptr shared_from_this() const + shared_ptr shared_from_this() const volatile { - init_weak_once(); - return shared_ptr( weak_this_ ); + return const_cast< enable_shared_from_raw const * >( this )->shared_from_this(); } // Note: invoked automatically by shared_ptr; do not call @@ -107,9 +106,11 @@ private: } } - mutable weak_ptr weak_this_; + mutable weak_ptr weak_this_; + private: - mutable shared_ptr shared_this_; + + mutable shared_ptr shared_this_; }; template diff --git a/include/boost/smart_ptr/shared_ptr.hpp b/include/boost/smart_ptr/shared_ptr.hpp index 83b0451..82ece8b 100644 --- a/include/boost/smart_ptr/shared_ptr.hpp +++ b/include/boost/smart_ptr/shared_ptr.hpp @@ -893,7 +893,7 @@ class esft2_deleter_wrapper { private: - shared_ptr deleter_; + shared_ptr deleter_; public: