C++几种智能指针之间的比较

如题所述

auto_ptr、unique_ptr、shared_ptr、weak_ptr。其中auto_ptr在C++98标准引入,后三种在C++11标准中加入。而auto_ptr已经被C++11所摒弃,建议使用后三种智能指针,这4种智能指针使用模板(template)实现。
温馨提示:答案为网友推荐,仅供参考
相似回答