Hristo Hristov 3f151a3fa6
[libc++][memory] Applied [[nodiscard]] to smart pointers (#168483)
Applied `[[nodiscard]]` where relevant to smart pointers and related
functions.

- [x] - `std::unique_ptr`
- [x] - `std::shared_ptr`
- [x] - `std::weak_ptr`

See guidelines:
-
https://libcxx.llvm.org/CodingGuidelines.html#apply-nodiscard-where-relevant
- `[[nodiscard]]` should be applied to functions where discarding the
return value is most likely a correctness issue. For example a locking
constructor in unique_lock.

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
2025-11-20 04:19:15 +02:00
..
2023-05-16 14:30:36 -07:00