From deab8ca1bb050c0a784220a7dc3cf38d61ddcd99 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 14 Feb 2003 10:55:20 +0000 Subject: [PATCH] Added link to enable_shared_from_this.html. [SVN r17397] --- sp_techniques.html | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sp_techniques.html b/sp_techniques.html index a157f0b..826195f 100644 --- a/sp_techniques.html +++ b/sp_techniques.html @@ -359,7 +359,7 @@ shared_ptr<X> make_shared_from_another(another_ptr<X> qx) instance. Example:

void f(X * p)
 {
-    shared_ptr<X> px(???);
+    shared_ptr<X> px(???);
 }
 

Inside f, we'd like to create a shared_ptr to *p.

@@ -389,7 +389,7 @@ public: X() { - shared_ptr<X> this_(???); + shared_ptr<X> this_(???); } }; @@ -461,7 +461,7 @@ public: virtual shared_ptr<X> getX() { - shared_ptr<X> px(???); + shared_ptr<X> px(???); return px; } }; @@ -496,8 +496,9 @@ public: } }; -

The library now includes a helper class template enable_shared_from_this - that can be used to encapsulate the solution:

+

The library now includes a helper class template + enable_shared_from_this that can be used to encapsulate the + solution:

class impl: public X, public Y, public enable_shared_from_this<impl>
 {
 public:
@@ -751,9 +752,9 @@ public:
 			all weak pointers will automatically expire.


$Date$

-

Copyright © 2003 Peter Dimov. Permission to copy, use, modify, sell and +

Copyright © 2003 Peter Dimov. Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies. This document is provided "as is" without express or implied - warranty, and with no claim as to its suitability for any purpose.

+ warranty, and with no claim as to its suitability for any purpose.