C++ Smart Pointers: unique, shared, weak
A practical guide to unique_ptr, shared_ptr, and weak_ptr in modern C++: ownership semantics, when to use each, and the pitfalls that lead to leaks and cycles.
·5 min read · #cpp#smart-pointers#memory
3 posts · page 1 of 1
A practical guide to unique_ptr, shared_ptr, and weak_ptr in modern C++: ownership semantics, when to use each, and the pitfalls that lead to leaks and cycles.
Demystify Rust's Deref, DerefMut, and AsRef traits with clear examples showing how smart pointers, coercions, and flexible APIs really work.
Understand when to reach for Box, Rc, and Arc in Rust, how each interacts with the borrow checker, and the cost of shared ownership across threads.