Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 #ifndef BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED
2 #define BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED
5 // enable_shared_from_this.hpp
7 // Copyright (c) 2002 Peter Dimov
9 // Distributed under the Boost Software License, Version 1.0. (See
10 // accompanying file LICENSE_1_0.txt or copy at
11 // http://www.boost.org/LICENSE_1_0.txt)
13 // http://www.boost.org/libs/smart_ptr/enable_shared_from_this.html
16 #include <boost/weak_ptr.hpp>
17 #include <boost/shared_ptr.hpp>
18 #include <boost/assert.hpp>
19 #include <boost/config.hpp>
24 template<class T> class enable_shared_from_this
28 enable_shared_from_this()
32 enable_shared_from_this(enable_shared_from_this const &)
36 enable_shared_from_this & operator=(enable_shared_from_this const &)
41 ~enable_shared_from_this()
47 shared_ptr<T> shared_from_this()
49 shared_ptr<T> p(_internal_weak_this);
50 BOOST_ASSERT(p.get() == this);
54 shared_ptr<T const> shared_from_this() const
56 shared_ptr<T const> p(_internal_weak_this);
57 BOOST_ASSERT(p.get() == this);
61 // Note: No, you don't need to initialize _internal_weak_this
63 // Please read the documentation, not the code
65 // http://www.boost.org/libs/smart_ptr/enable_shared_from_this.html
67 typedef T _internal_element_type; // for bcc 5.5.1
68 mutable weak_ptr<_internal_element_type> _internal_weak_this;
73 #endif // #ifndef BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED