Is std::cout guaranteed to be initialized?
问题 What I know about C++ is that the order of the constructions (and destructions) of global instances should not be assumed. While I'm writing code with a global instance which uses std::cout in the constructor & destructor, I got a question. std::cout is also a global instance of iostream. Is std::cout guaranteed to be initialized before any other global instances? I wrote a simple test code and it works perfectly, but still I don't know why. #include <iostream> struct test { test() { std: