mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2026-09-24 15:00:31 +08:00
* refactor: clean to roadmap content * refactor: move shared helpers into scripts/lib
877 B
877 B
unique_ptr
unique_ptr is a smart pointer in C++ that provides exclusive ownership of a dynamically allocated object. It ensures that only one unique_ptr can point to a given object at any time, preventing memory leaks by automatically deleting the managed object when the unique_ptr goes out of scope or is explicitly reset. Ownership can be transferred to another unique_ptr using std::move, but copying is disallowed to enforce the single-ownership principle.
Visit the following resources to learn more: