Skip to content

Commit e3826bf

Browse files
SergeCroisenico
authored andcommitted
Documentation: Fix typos in SmartPointers.md
1 parent 7eab595 commit e3826bf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Documentation/SmartPointers.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ These pointers cannot be copied. Transferring ownership is done by moving the po
2020

2121
`NonnullOwnPtr` is a special variant of `OwnPtr` with one additional property: it cannot be null. `NonnullOwnPtr` is suitable as a return type from functions that are guaranteed to never return null, and as an argument type where ownership is transferred, and the argument may not be null. In other words, if `OwnPtr` is "\*", then `NonnullOwnPtr` is "&".
2222

23-
Note: A `NonnullOwnPtr` can be assigned to an `OwnPtr` but not vice versa. To transform an known-non-null `OwnPtr` into a `NonnullOwnPtr`, use `OwnPtr::release_nonnull()`.
23+
Note: A `NonnullOwnPtr` can be assigned to an `OwnPtr` but not vice versa. To transform a known-non-null `OwnPtr` into a `NonnullOwnPtr`, use `OwnPtr::release_nonnull()`.
2424

2525
### Construction using helper functions
2626

@@ -89,7 +89,7 @@ class Bar : public RefCounted<Bar> {
8989
};
9090
```
9191
92-
Note: A `NonnullRefPtr` can be assigned to a `RefPtr` but not vice versa. To transform an known-non-null `RefPtr` into a `NonnullRefPtr`, either use `RefPtr::release_nonnull()` or simply dereference the `RefPtr` using its `operator*`.
92+
Note: A `NonnullRefPtr` can be assigned to a `RefPtr` but not vice versa. To transform a known-non-null `RefPtr` into a `NonnullRefPtr`, either use `RefPtr::release_nonnull()` or simply dereference the `RefPtr` using its `operator*`.
9393
9494
### Construction using helper functions
9595
@@ -125,7 +125,7 @@ NonnullRefPtr<Bar> our_object = adopt_ref(*new Bar);
125125

126126
Note: It is safe to immediately dereference this raw pointer, as the normal `new` expression cannot return a null pointer.
127127

128-
Any (possibly null) pointer to a reference-counted object can can be turned into a `RefPtr` by the global `adopt_ref_if_nonnull()` function.
128+
Any (possibly null) pointer to a reference-counted object can be turned into a `RefPtr` by the global `adopt_ref_if_nonnull()` function.
129129

130130
```cpp
131131
RefPtr<Bar> our_object = adopt_ref_if_nonnull(new (nothrow) Bar);

0 commit comments

Comments
 (0)