Back to Browse

Learn Modern C++: Smart Pointer unique_ptr

801 views
Jul 26, 2025
31:00

#cpp #cppprogramminglanguage #programming #robotics It takes a significant amount of time and energy to create these free video tutorials. You can support my efforts in this way: - Buy me a Coffee: https://www.buymeacoffee.com/AleksandarHaber - PayPal: https://www.paypal.me/AleksandarHaber - Patreon: https://www.patreon.com/user?u=32080176&fan_landing=true - You Can also press the Thanks YouTube Dollar button - In this lecture on modern C++, we briefly explain the smart pointer called unique_prt and we explain how to use it in C++ code. To avoid problems with memory leaks and similar problems, the modern C++ programming language strongly discourages the use of raw (standard) pointers except for some cases. Instead, programs and programmers are encouraged to use smart pointers. - A smart pointer is a class template that is declared on the stack and initialized by using a pointer that points to the memory on heap. - The smart pointer will automatically delete the memory that the raw pointer points to. That is, we do not need to use the delete operator! - Inside of the destructor (smart pointer is a class template!) of the smart pointer there is a call to delete that releases the memory!

Download

0 formats

No download links available.

Learn Modern C++: Smart Pointer unique_ptr | NatokHD