Let's say you defined a couple file-level static objects:
//foo.cpp
static std::map<std::string, std::string> bar;
static MyCustomCompicatedClass baz;
Does c++ standard regulate their lifetime? When exactly will their destructors get called?
I've heard that global statics are never a good idea and may crash your program if their destructors get called after vcruntime gets loaded out of memory (on Windows, anyway). Is that true? Can someone share the details? What about other platforms?