智能指针思想实践(std::unique_ptr, std::shared_ptr)

1 smart pointer 思想 ​ 个人认为smart pointer实际上就是一个对原始指针类型的一个封装类,并对外提供了-> 和 * 两种操作,使得其能够表现出原始指针的操作行为。 ​ 要理解smart pointer思想首先要了解一个概念RAII(Resource Acquisition

你可能感兴趣的:(智能指针思想实践(std::unique_ptr, std::shared_ptr))