 <p>I don't like <code>static</code> data members much, the problem of initialization being foremost.</p> <p>Whenever I have to do significant processing, I cheat and use a local <code>static</code> instead:</p> <pre><code>class MyClass { public: static const SomeOtherClass&amp; myVariable(); }; const SomeOtherClass&amp; MyClass::myVariable() { static const SomeOtherClass MyVariable(someOtherFunction()); return MyVariable; } </code></pre> <p>This way, the exception will be throw only on first use, and yet the object will be <code>const</code>.</p> <p>This is quite a powerful idiom to delay execution. It had a little overhead (basically the compiler checks a flag each time it enters the method), but better worry about correctness first ;)</p> <p>If this is called from multiple threads:</p> <ul> <li>if your compiler handles it, fine</li> <li>if your compiler does not, you may be able to use local thread storage (it's const anyway)</li> <li>you could use <code>boost::once</code> in the <code>Boost.Threads</code> library</li> <li>since it's <code>const</code>, you may not care if it's initialized multiple times, unless <code>someOtherFunction</code> does not support parallel execution (beware of resources)</li> </ul> <p><strong>Guideline</strong>: only use <code>static</code> or <code>global</code> variables instantiation for simple objects (that cannot throw), otherwise use <code>local static</code> variables to delay execution until you can catch the resulting exceptions.</p>