
std::unique_ptr
`std::unique_ptr` is a smart pointer in C++ that manages a single object's lifetime. It automatically deletes the object when the `unique_ptr` goes out of scope, ensuring proper resource cleanup. Only one `unique_ptr` can own a specific object at any time, preventing multiple pointers from accidentally deleting the same resource. This makes code safer and easier to manage, as it clearly defines ownership and handles memory deallocation automatically, reducing the risk of memory leaks.