title: Singleton with static member instance
body: <p>I've got a Singleton implementation where I am not sure which drawbacks it contains. Could anybody tell me how good this implementation is?</p>
  
  <pre><code>template &lt;class Child&gt;
  class Singleton {
  
  public:
  
      inline static Child&amp; Instance() {   
          return Instance_;
      }
  
      Singleton(const Singleton&amp;) = delete;
      Singleton(Singleton&amp;&amp;) = delete;
  
      Singleton&amp; operator=(const Singleton&amp;) = delete;
      Singleton&amp; operator=(Singleton&amp;&amp;) = delete;
  
  protected:
  
      Singleton() = default;
  
  private:
  
      static Child Instance_;
  
  };
  
  template &lt;typename Child&gt; Child Singleton&lt;Child&gt;::Instance_;
  </code></pre>
  
  <p>I know of a Singleton implementation by Scott Meyers that defines the static <code>Instance_</code> inside the <code>GetInstance()</code> function.</p>
  
  <pre><code>inline static Child&amp; Instance() {   
      static Child Instance_;
      return Instance_;
  }
  </code></pre>
  
  <p>But isn't there additional overhead involved, because it has to check every time the function is invoked whether <code>Instance_</code> has already been initialized.</p>