forked from boostorg/smart_ptr
Added link to enable_shared_from_this.html.
[SVN r17397]
This commit is contained in:
@ -359,7 +359,7 @@ shared_ptr<X> make_shared_from_another(another_ptr<X> qx)
|
|||||||
instance. Example:</p>
|
instance. Example:</p>
|
||||||
<pre>void f(X * p)
|
<pre>void f(X * p)
|
||||||
{
|
{
|
||||||
shared_ptr<X> px(<i>???</I>);
|
shared_ptr<X> px(<i>???</i>);
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
<p>Inside <code>f</code>, we'd like to create a <code>shared_ptr</code> to <code>*p</code>.</p>
|
<p>Inside <code>f</code>, we'd like to create a <code>shared_ptr</code> to <code>*p</code>.</p>
|
||||||
@ -389,7 +389,7 @@ public:
|
|||||||
|
|
||||||
X()
|
X()
|
||||||
{
|
{
|
||||||
shared_ptr<X> this_(<i>???</I>);
|
shared_ptr<X> this_(<i>???</i>);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</pre>
|
</pre>
|
||||||
@ -461,7 +461,7 @@ public:
|
|||||||
|
|
||||||
virtual shared_ptr<X> getX()
|
virtual shared_ptr<X> getX()
|
||||||
{
|
{
|
||||||
shared_ptr<X> px(<i>???</I>);
|
shared_ptr<X> px(<i>???</i>);
|
||||||
return px;
|
return px;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -496,8 +496,9 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
</pre>
|
</pre>
|
||||||
<p>The library now includes a helper class template <code>enable_shared_from_this</code>
|
<p>The library now includes a helper class template <code><A href="enable_shared_from_this.html">
|
||||||
that can be used to encapsulate the solution:</p>
|
enable_shared_from_this</A></code> that can be used to encapsulate the
|
||||||
|
solution:</p>
|
||||||
<pre>class impl: public X, public Y, public enable_shared_from_this<impl>
|
<pre>class impl: public X, public Y, public enable_shared_from_this<impl>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -751,9 +752,9 @@ public:
|
|||||||
all weak pointers will automatically expire.</p>
|
all weak pointers will automatically expire.</p>
|
||||||
<hr>
|
<hr>
|
||||||
<p>$Date$</p>
|
<p>$Date$</p>
|
||||||
<p>Copyright <20> 2003 Peter Dimov. Permission to copy, use, modify, sell and
|
<p><small>Copyright <20> 2003 Peter Dimov. Permission to copy, use, modify, sell and
|
||||||
distribute this document is granted provided this copyright notice appears in
|
distribute this document is granted provided this copyright notice appears in
|
||||||
all copies. This document is provided "as is" without express or implied
|
all copies. This document is provided "as is" without express or implied
|
||||||
warranty, and with no claim as to its suitability for any purpose.</p>
|
warranty, and with no claim as to its suitability for any purpose.</small></p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Reference in New Issue
Block a user