enable_shared_from_this-related fixes.

[SVN r16341]
This commit is contained in:
Peter Dimov committed 2002-11-20 12:38:51 +00:00
1 parent 4b200e9847
commit 804b1483c7
4 files changed
+42 -35

No files matched your search

+4 -12
View File
@@ -28,28 +28,20 @@ public:
shared_ptr<T> shared_from_this()
{
shared_ptr<T> p(weak_this);
shared_ptr<T> p(_internal_weak_this);
BOOST_ASSERT(p.get() == this);
return p;
}
shared_ptr<T const> shared_from_this() const
{
shared_ptr<T const> p(weak_this);
shared_ptr<T const> p(_internal_weak_this);
BOOST_ASSERT(p.get() == this);
return p;
}
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
private:
template<class Y> friend class shared_ptr;
#endif
typedef T element_type; // for bcc 5.5.1
weak_ptr<element_type> weak_this;
typedef T _internal_element_type; // for bcc 5.5.1
weak_ptr<_internal_element_type> _internal_weak_this;
};
} // namespace boost