What is the rationale for not having static constructor in C++?
问题 What is the rationale for not having static constructor in C++? If it were allowed, we would be initializing all the static members in it, at one place in a very organized way, as: //illegal C++ class sample { public: static int some_integer; static std::vector<std::string> strings; //illegal constructor! static sample() { some_integer = 100; strings.push_back("stack"); strings.push_back("overflow"); } }; In the absense of static constructor, it's very difficult to have static vector, and