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
Copy file name to clipboardExpand all lines: README.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,3 +53,13 @@ int main() {
53
53
return 0;
54
54
}
55
55
```
56
+
57
+
## Limitation
58
+
59
+
- Because of the unique ownership, weak pointers locking cannot extend the lifetime of the pointed object, hence `observable_unique_ptr` provides less thread-safety compared to `std::shared_ptr`.
60
+
-`observable_unique_ptr` does not support pointers to arrays, but `std::unique_ptr` and `std::shared_ptr` both do.
61
+
-`observable_unique_ptr` does not support custom allocators, but `std::shared_ptr` does.
62
+
-`observable_unique_ptr` does not have a `release()` function to let go of the ownership, which `std::unique_ptr` has.
63
+
-`observable_unique_ptr` allows moving from other `observable_unique_ptr` only if the deleter type is exactly the same, while `std::unique_ptr` allows moving from a convertible deleter.
64
+
-`observable_unique_ptr may or may not own a deleter instance; if in doubt, check `has_deleter()`` before calling `get_deleter()`, or use `try_get_deleter()`.
65
+
- a moved-from `observable_unique_ptr` will not own a deleter instance.
0 commit comments