From deab8ca1bb050c0a784220a7dc3cf38d61ddcd99 Mon Sep 17 00:00:00 2001
From: Peter Dimov
void f(X * p)
{
- shared_ptr<X> px(???);
+ shared_ptr<X> px(???);
}
Inside f, we'd like to create a shared_ptr to *p.
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.