title: Thread Safe singleton in C++ using static member instance (no lazy instantiation)
body: <p>I am aware of the Meyers singleton:</p>
  
  <pre><code>class Singleton{
  private:
      Singleton();
  
  public:
      Singleton &amp; GetInstance(){
          static Singleton instance;
          return instance;
      }
  }
  </code></pre>
  
  <p>The advantages of it is that it uses lazy evaluation but it is not guaranteed to be thread-safe in C++ 03.</p>
  
  <p>What if the static instance is a member variable? Is that guaranteed to be thread-safe? I don't see why not. Moreover I'm willing to give up the lazy instantiation for that.</p>
  
  <pre><code>class Singleton{
  private:
      Singleton();
      static Singleton instance;
  
  public:
      Singleton &amp; GetInstance(){
          return instance;
      }
  }
  </code></pre>