A simple Class T
Class T {public: t () {value = 0x12345678;} ~ t () {value = 0;} int value;
Plus a simple foo function, define a static partial object:
Void foo () {static t t;}
After the compiler is expanded, it is actually the same as us.
Char Tmemory [SIZEOF (T)]; int Tinit = 0; void tfree () {((t *) tmemory -> ~ t ();}
Void foo () {if (! tinit) {Tinit = 1; New (tmemory) t (); atexit (tfree);}}