编程沉思录
  • Home
  • Featured
  • Collections
    • About
    • RSS
  • Home
  • Featured
  • Collections
  • About
  • RSS
  • Search

#智能指针

含有 #智能指针 标签的所有内容。

2 posts

从源码角度解读 enable_shared_from_this

我们在使用 C++ 的时候,有时会需要在类的内部获取自身的 shared_ptr,这就会用到 std::enable_shared_from_this。在实际使用过程中,std::enable_shared_from_this 有三个陷阱需要注意:

Continue reading →
Jan 4, 2025
dev

C++ 智能指针的正确使用方式

C++11 中推出了三种智能指针,unique_ptr、shared_ptr 和 weak_ptr,同时也将 auto_ptr 置为废弃 (deprecated)。

Continue reading →
Oct 5, 2019
dev
编程沉思录 45 Posts 7 Links ~84k words written
Since 2015 Updated today RSS