C++智能指针

2014-11-24 11:48:48 · 作者: · 浏览: 4

Smart_ptr is the same as a normal pointer, but it provides safety via automatic memory.

It avoids dangling pointers, memory leaks, allocation failures etc.

The smart pointer must maintain a single reference count for all instances.