Top Categories
JOIN THIS CHANNEL: youtube https://www.youtube.com/channel/UCs6sf4iRhhE875T1QjG3wPQ/join patreon https://www.patreon.com/cppnuts play list for Smart Pointers: https://www.youtube.com/watch?v=wUzn0HljjRE&list=PLk6CEY9XxSIAI2K-sxrKzzSyT6UZR5ObP play list for STL: https://www.youtube.com/watch?v
JOIN THIS CHANNEL: youtube https://www.youtube.com/channel/UCs6sf4iRhhE875T1QjG3wPQ/join patreon https://www.patreon.com/cppnuts play list for Smart Pointers: https://www.youtube.com/watch?v=wUzn0HljjRE&list=PLk6CEY9XxSIAI2K-sxrKzzSyT6UZR5ObP play list for STL: https://www.youtube.com/watch?v=LyGlTmaWEPs&list=PLk6CEY9XxSIA-xo3HRYC3M0Aitzdut7AA play list for C++14: https://www.youtube.com/watch?v=1EAL_RRCKhY&list=PLk6CEY9XxSIAloDTEauOy_ss9fEqSP4JR play list for Threads In C++: https://www.youtube.com/watch?v=TPVH_coGAQs&list=PLk6CEY9XxSIAeK-EAh3hB4fgNvYkYmghp play list for C++ Interview Questions And Answer: https://www.youtube.com/watch?v=QSuBwGmFQqA&list=PLk6CEY9XxSIDy8qVHZV-Nf-r9f2BkRZ6p play list for C++ Tutoria For Beginners: https://www.youtube.com/watch?v=3IynvwjrV-U&list=PLk6CEY9XxSIAQ2vE_Jb4Dbmum7UfQrXgt paly list for Design Patterns: https://www.youtube.com/watch?v=XyNWEWUSa5E&list=PLk6CEY9XxSIDZhQURp6d8Sgp-A0yKKDKV play list for Linked List Interview Questions: https://www.youtube.com/watch?v=M5tQ4fJMsr0&list=PLk6CEY9XxSICJ0XSI7fbQFiEpDHISJxqT play list for Data Structures: https://www.youtube.com/watch?v=7tLVMUKLu2s&list=PLk6CEY9XxSIBG2Gv6-d1WE3Uxqx94o5B2 play list for Type Casts: https://www.youtube.com/watch?v=HlNVgmvX1EI&list=PLk6CEY9XxSIC6I_HCjMTGf8eV2Ty0a19E DESCRIPTION: In this video we will learn about shared pointer in smart pointer series in c++. There are few points about it: 0. shared_ptr is a smart pointer which can share the ownership of object (managed object). 1. Several shared_ptr can point to the same object (managed object). 2. It keep a reference count to maintain how many shared_ptr are pointing to the same object. and once last shared_ptr goes out of scope then the managed object gets deleted. 3. shared_ptr is threads safe and not thread safe. [what is this??] a. control block is thread safe b. managed object is not 4. There are three ways shared_ptr will destroyed managed object. a. If the last shared_ptr goes out of scope. b. If you initialize shared_ptr with some other shared_ptr. c. If you reset shared_ptr. 5. Reference count doesn't work when we use reference or pointer of shared_ptr. #shared_ptr #smartPointer #CppNuts