From af6fe18c9d2f383e10f584df899963aeb89ca1fa Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 15 Jul 2002 12:52:29 +0000 Subject: [PATCH] Minor fixes. [SVN r14464] --- weak_ptr.htm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/weak_ptr.htm b/weak_ptr.htm index 72104fb..8e284d1 100644 --- a/weak_ptr.htm +++ b/weak_ptr.htm @@ -8,9 +8,9 @@

c++boost.gif (8819 bytes)weak_ptr class template

The weak_ptr class template stores a pointer to an object that's already - managed by a shared_ptr. When the object last shared_ptr to the - object goes away and the object is deleted, all weak_ptr objects have - their stored pointers set to 0.

+ managed by a shared_ptr. When the last shared_ptr to the object + goes away and the object is deleted, all weak_ptr objects have their + stored pointers set to 0.

Every weak_ptr meets the CopyConstructible and Assignable requirements of the C++ Standard Library, and so can be used in standard library containers. Comparison operators are supplied so that weak_ptr works with the @@ -30,7 +30,7 @@ weak_ptr<int> q(p); if(int * r = q.get()) { - // use *r + // use *r }

Imagine that after the if, but immediately before r @@ -46,7 +46,7 @@ weak_ptr<int> q(p); if(shared_ptr<int> r = make_shared(q)) { - // use *r + // use *r }

Now r holds a reference to the object that was pointed by q. @@ -101,7 +101,7 @@ if(shared_ptr<int> r = make_shared(q))

Provides the type of the template parameter T.

constructors

-
explicit weak_ptr();
+
 weak_ptr();

Effects: Constructs a weak_ptr.

Postconditions: use count is 0; the stored