Hi Sebastien,
Use an class method accessor to guarantee initialization.
class NoGood { public: static Thingy thing; }; // Hey, not always initialized! Thingy NoGood::thing("alpha", "beta");
- - - - -
class ThisWorks { public: static Thingy& GetThingy(); }; Thingy& ThisWorks::GetThingy() { static Thingy thing("alpha", "beta"); return thing; }
HTH, --Eljay