Add weak_from_this.

This commit is contained in:
Peter Dimov committed 2015-01-25 20:10:57 +02:00
1 parent 3fd53ced83
commit 7104e7dc7e
6 files changed
+178 -28

No files matched your search

@@ -58,6 +58,16 @@ public:
return p;
}
weak_ptr<T> weak_from_this() BOOST_NOEXCEPT
{
return weak_this_;
}
weak_ptr<T const> weak_from_this() const BOOST_NOEXCEPT
{
return weak_this_;
}
public: // actually private, but avoids compiler template friendship issues
// Note: invoked automatically by shared_ptr; do not call