C++ 11

Smart Pointer vs Raw Pointer in C++

In this article, we will compare the C++11 Smart Pointer implementation shared_ptr with a normal pointer. Missing ++, – – and [] operators in shared_ptr While shared_ptr in C++ offers robust memory management and facilitates collaborative ownership of resources, it intentionally lacks some operators that are available to raw pointers. This is primarily to prevent […]

Smart Pointer vs Raw Pointer in C++ Read More »

What is shared_ptr in C++?

In this article, we will discuss one of the most used Smart Pointers in C++: shared_ptr. What is std::shared_ptr<>? The std::shared_ptr is a smart pointer class provided by C++11. Multiple std::shared_ptr objects can point to same dynamically allocated memory. It ensures automatic deletion of the associated memory when there are no more shared_ptr instances pointing

What is shared_ptr in C++? Read More »

Scroll to Top