item19:create

This commit is contained in:
kelthuzadx 2019-06-29 22:59:22 +08:00
parent 9f903b7075
commit e7ea0c9d1d
2 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1,4 @@
## Item 19:对于共享资源使用std::shared_ptr
条款十九:对于共享资源使用std::shared_ptr
程序员使用带垃圾回收的语言指着C++笑看他们如何防止资源泄露。“真是原始啊”它们嘲笑着说。“你们没有从1960年Lisp那里得到启发吗机器应该自己管理资源生命周期而不应该依赖人类。”

View File

@ -34,7 +34,7 @@
11. [Item 17:理解特殊成员函数函数的生成](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/3.MovingToModernCpp/item17.md)
4. 智能指针
1. [Item 18:对于独占资源使用std::unique_ptr](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/4.SmartPointers/item18.md) __更新中__
2. Item 19:对于共享资源使用std::shared_ptr
2. [Item 19:对于共享资源使用std::shared_ptr](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/4.SmartPointers/item19.md) __更新中__
3. Item 20:对于类似于std::shared_ptr的指针使用std::weak_ptr可能造成悬置
4. Item 21:优先考虑使用std::make_unique和std::make_shared而非new
5. Item 22:当使用Pimpl惯用法请在实现文件中定义特殊成员函数