Emulating the static initialization blocks of Java in C++