title: C++ singleton vs completely static object
body: <p>Let say we need to have just one instance of some class in our project. There are couple ways of doing it.</p>
  
  <p>I want to compare. Please can you review my understanding.</p>
  
  <p>1) Classical Singleton pattern</p>
  
  <p>2) Completely static class (all methods and members are static).</p>
  
  <p><br>
  As I understand the differences are following:</p>
  
  <p>a) The order of initialization of static members across different units isn't defined.
  So, completely static members initialization can't use any static members/functions from other modules. And singleton doesn't have this problem.</p>
  
  <p>b) We have to deal with threading for getInstance() of Singleton. However, completely static class doesn't have this problem.</p>
  
  <p>c) Access to methods looks a little bit different. 
  Foo::bar(); vs Foo::getInstance()->bar();
  Generally, singleton can return NULL to identify that there were some problems with construction of object and static class can't.</p>
  
  <p>d) Definition of class looks a little bit clunky with bunch of statics for static class.</p>
  
  <p>Have I missed anything? </p>