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 @@
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.
explicit weak_ptr();+
weak_ptr();
Effects: Constructs a weak_ptr.
Postconditions: use count is 0; the stored