title: C++11 Singleton. Static variable is thread safe? Why?
body: <p>I just read, that this construct:</p>
  
  <pre><code>const bg::AppSettings&amp; bg::AppSettings::GetInstance()
  {
      static AppSettings instance;
      return instance;
  }
  </code></pre>
  
  <p>is a thread safe and working way to create a singleton?! Am I correct, that the static AppSettings variable will be the same, every time I call this method?! I get a little bit confused about the scoping on this one ... </p>
  
  <p>My normal approach was to use a unique_ptr as a static member of my class ... but this seems to work...can someone explain to me, what's going on here?! </p>
  
  <p>And btw.: does the const make sense here?!</p>