std::unique_ptr - A scoped smart pointer | Modern Cpp Series Ep. 33

Опубликовано: 10 Май 2025
на канале: Mike Shah
14,250
531

►Full C++ Series Playlist:    • The C++ Programming Language  
►Find full courses on: https://courses.mshah.io/
►Join as Member to Support the channel:    / @mikeshah  

►Lesson Description: In this lesson I show you how to use a std::unique_ptr. I will show you why we might want to use this smart pointer versus a raw pointer, and how to create this pointer. While we haven't covered classes yet in this series, it's important to realize that this smart pointer is essentially a 'wrapper' around a raw pointer that calls the destructor to free memory when the pointer leaves scope.

Note: Something not covered in this lesson is the idea of a 'custom deleter' which can be useful.

►YouTube Channel:    / mikeshah  
►Please like and subscribe to help the channel!