This question was asked to me in an interview:
What is a static constructor?
Does it exist in C++? If yes, please explain it wit
Here is the simplest static constructor in c++17:
#include class h { public: static inline int i; private: struct constructor { constructor() { i=3; } }; static inline constructor cons; }; int main() { std::cout << h::i; }