C++ static data members initialization

前端 未结 2 682
南笙
南笙 2021-01-27 03:58

1) Is it true that static data members of classes always get initialized before main() called?

2) Is it true that \"static initialization order fiasco\" can happen if st

2条回答
  •  失恋的感觉
    2021-01-27 04:34

    Yes to both answers.

    see https://isocpp.org/wiki/faq/ctors#static-init-order for a good description of it.

提交回复
热议问题