cpp/memory/raii_in_cpp #128
Replies: 1 comment
-
|
std::ifstream这些标准库的函数都是符合RAII的,会自动析构,以及常用的std::lock_guard也是用到了这种思想,自动管理mutex的释放 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
cpp/memory/raii_in_cpp
本文详细介绍了C++中RAII(Resource Acquisition Is Initialization)的原理和应用,包括资源获取即初始化、资源管理、异常安全和内存安全等方面的分析。
https://csguide.cn/cpp/memory/raii_in_cpp.html
Beta Was this translation helpful? Give feedback.
All reactions