You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2e76ff1
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/standard-library/shared-ptr-class.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,13 +78,13 @@ no arguments -- the resulting object is an empty `shared_ptr` object or an empty
78
78
79
79
`ptr, deleter` -- a pointer of type `Other*` to the resource to be managed and a deleter for that resource. If the function fails (because the control block cannot be allocated), it calls `deleter(ptr)`, which must be well defined.
80
80
81
-
`ptr, deleter, alloc` -- a pointer of type `Other*` to the resource to be managed, a deleter for that resource, and an allocator to manage any storage that must be allocated and freed. If the function fails (because the control block can't be allocated) it calls `deleter(ptr)`, which must be well defined.
81
+
`ptr, deleter, alloc` -- a pointer of type `Other*` to the resource to be managed, a deleter for that resource, and an allocator to manage any storage that must be allocated and freed. If the function fails (because the control block can't be allocated), it calls `deleter(ptr)`, which must be well defined.
82
82
83
83
`sp` -- a `shared_ptr<Other>` object that owns the resource to be managed.
84
84
85
85
`wp` -- a `weak_ptr<Other>` object that points to the resource to be managed.
86
86
87
-
`ap` -- an `auto_ptr<Other>` object that holds a pointer to the resource to be managed. If the function succeeds it calls `ap.release()`; otherwise it leaves `ap` unchanged.
87
+
`ap` -- an `auto_ptr<Other>` object that holds a pointer to the resource to be managed. If the function succeeds, it calls `ap.release()`; otherwise it leaves `ap` unchanged.
88
88
89
89
In all cases, the pointer type `Other*` must be convertible to `T*`.
The member function returns the address of the owned resource. If the object does not own a resource it returns 0.
164
+
The member function returns the address of the owned resource. If the object does not own a resource, it returns 0.
165
165
166
166
### Example
167
167
@@ -303,7 +303,7 @@ The type of the deleter of the owned object, stored for later deletion of the ob
303
303
304
304
### Remarks
305
305
306
-
The operators all decrement the reference count for the resource currently owned by `*this` and assign ownership of the resource named by the operand sequence to `*this`. If the reference count falls to zero, the resource is released. If an operator fails it leaves `*this` unchanged.
306
+
The operators all decrement the reference count for the resource currently owned by `*this` and assign ownership of the resource named by the operand sequence to `*this`. If the reference count falls to zero, the resource is released. If an operator fails, it leaves `*this` unchanged.
307
307
308
308
### Example
309
309
@@ -436,7 +436,7 @@ The allocator to copy.
436
436
437
437
### Remarks
438
438
439
-
The operators all decrement the reference count for the resource currently owned by `*this` and assign ownership of the resource named by the operand sequence to `*this`. If the reference count falls to zero, the resource is released. If an operator fails it leaves `*this` unchanged.
439
+
The operators all decrement the reference count for the resource currently owned by `*this` and assign ownership of the resource named by the operand sequence to `*this`. If the reference count falls to zero, the resource is released. If an operator fails, it leaves `*this` unchanged.
0 commit comments