Quantcast
Channel: Cpp11 – On C++ and other OOPscenities
Viewing all articles
Browse latest Browse all 23

C++: Smart pointers, part 4: shared_ptr

$
0
0
As I mentioned in other posts, C++11 brings a new set of smart pointers into C++. The most useful smart pointer is shared_ptr: Its memory management policy consists in counting the number of shared_ptr instances that refer to the same object in the heap. For example, if you have something like this: shared_ptr<int> x(new int […]

Viewing all articles
Browse latest Browse all 23

Trending Articles