Static storage duration
1、本章对object with static storage duration一些问题进行专门总结和介绍。
2、cppreference中,对于object with static storage duration的相关内容是比较分散的,本文将相关内容进行了整理。
3、cppreference Initialization#Non-local variables 章节的内容是难以阅读的,所以本文会首先使用一篇非常容易理解的文章作为开头,从而对object with static storage duration有一个完整的认知。
Lifetime of object with static storage duration
对于object with static storage duration,C++语言有着特殊的设计,根据object的scope,我们进一步将它们分为:
classification | 描述章节 |
---|---|
Non-local object with static storage duration | Non-local-object |
Local object with static storage duration | Static-local-object |