/usr/include/boost/smart_ptr
NameSizeModeActions
detail/-0755rm
allocate_local_shared_array.hpp56550644editdlrm
allocate_shared_array.hpp99590644editdlrm
allocate_unique.hpp123690644editdlrm
atomic_shared_ptr.hpp58150644editdlrm
bad_weak_ptr.hpp17440644editdlrm
enable_shared_from.hpp11840644editdlrm
enable_shared_from_raw.hpp44790644editdlrm
enable_shared_from_this.hpp21750644editdlrm
intrusive_ptr.hpp94270644editdlrm
intrusive_ref_counter.hpp58170644editdlrm
local_shared_ptr.hpp193770644editdlrm
make_local_shared.hpp5760644editdlrm
make_local_shared_array.hpp21790644editdlrm
make_local_shared_object.hpp47870644editdlrm
make_shared.hpp7070644editdlrm
make_shared_array.hpp19960644editdlrm
make_shared_object.hpp246220644editdlrm
make_unique.hpp17830644editdlrm
owner_equal_to.hpp6710644editdlrm
owner_hash.hpp6000644editdlrm
owner_less.hpp8530644editdlrm
scoped_array.hpp33010644editdlrm
scoped_ptr.hpp40820644editdlrm
shared_array.hpp72520644editdlrm
shared_ptr.hpp311990644editdlrm
weak_ptr.hpp75820644editdlrm
Edit: /usr/include/boost/smart_ptr/enable_shared_from_this.hpp (2175B)
#ifndef BOOST_SMART_PTR_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED #define BOOST_SMART_PTR_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED // // enable_shared_from_this.hpp // // Copyright 2002, 2009 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt // // See http://www.boost.org/libs/smart_ptr/ for documentation. // #include #include #include #include #include namespace boost { template class enable_shared_from_this { protected: BOOST_CONSTEXPR enable_shared_from_this() BOOST_SP_NOEXCEPT { } BOOST_CONSTEXPR enable_shared_from_this(enable_shared_from_this const &) BOOST_SP_NOEXCEPT { } enable_shared_from_this & operator=(enable_shared_from_this const &) BOOST_SP_NOEXCEPT { return *this; } ~enable_shared_from_this() BOOST_SP_NOEXCEPT // ~weak_ptr newer throws, so this call also must not throw { } public: shared_ptr shared_from_this() { shared_ptr p( weak_this_ ); BOOST_ASSERT( p.get() == this ); return p; } shared_ptr shared_from_this() const { shared_ptr p( weak_this_ ); BOOST_ASSERT( p.get() == this ); return p; } weak_ptr weak_from_this() BOOST_SP_NOEXCEPT { return weak_this_; } weak_ptr weak_from_this() const BOOST_SP_NOEXCEPT { return weak_this_; } public: // actually private, but avoids compiler template friendship issues // Note: invoked automatically by shared_ptr; do not call template void _internal_accept_owner( shared_ptr const * ppx, Y * py ) const BOOST_SP_NOEXCEPT { if( weak_this_.expired() ) { weak_this_ = shared_ptr( *ppx, py ); } } private: mutable weak_ptr weak_this_; }; } // namespace boost #endif // #ifndef BOOST_SMART_PTR_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED