Static variables initialisation order

后端 未结 7 1127
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-22 15:20

C++ guarantees that variables in a compilation unit (.cpp file) are initialised in order of declaration. For number of compilation units this rule works for each one separat

相关标签:
7条回答
  • 2020-11-22 16:02

    http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.12 - this link moves around. this one is more stable but you will have to look around for it.

    edit: osgx supplied a better link.

    0 讨论(0)
提交回复
热议问题