C++ 智能指针实现
摘要:C++ 智能指针实现 C++ 使用智能指针管理资源。C++11 有shared_ptr, weak_ptr, unique_ptr 三种智能指针。unique_ptr 实现比较简单,注意避免拷贝和赋值,要使用移动构造函数进行对象所有权的转移。这里只介绍shared_ptr, weak_ptr 的实现
阅读全文
posted @ 2022-09-21 17:11
posted @ 2022-09-21 17:11
posted @ 2022-09-15 23:15
posted @ 2022-09-11 15:45
posted @ 2022-09-07 22:52
posted @ 2022-09-06 23:26