title: Class with private constructor and static array of itself
body: <p>Sorry if title is confusing, I couldn't find an easy way to write it in a simple sentence. Anyways, the issue I'm facing:</p>
  
  <pre><code> // header:
  class SomeThing
  {
   private:
     SomeThing() {} // &lt;- so users of this class can't come up
                    //    with non-initialized instances, but
                    //    but the implementation can.
  
     int some_data; // &lt;- a few bytes of memory, the default
                    //    constructor SomeThing() doesn't initialize it
   public:
     SomeThing(blablabla ctor arguments);
  
     static SomeThing getThatThing(blablabla arguments);
  
     static void generateLookupTables();
   private:
  
     // declarations of lookup tables
     static std::array&lt;SomeThing, 64&gt; lookup_table_0;
     static SomeThing lookup_table_1[64];
  };
  </code></pre>
  
  <p>The <code>getThatThing</code> function is meant to return an instance from a lookup table.</p>
  
  <pre><code> // in the implementation file - definitions of lookup tables
  
   std::array&lt;SomeThing, 64&gt; SomeThing::lookup_table_0; // error
  
   SomeThing Something::lookup_table_1[64]; // &lt;- works fine
  </code></pre>
  
  <p>I just can't use a <code>std::array</code> of <code>Something</code>, unless I add a public ctor <code>SomeThing()</code> in  the class. It works fine with old-style arrays, I can define the array, and fill it up in the <code>SomeThing::generateLookupTables()</code> function. Apparently the type <code>std::array&lt;SomeThing, 64&gt;</code> does not have a constructor. Any ideas on how to make it work, or maybe a better structure for this concept?</p>
  
  <p>============= EDIT =======</p>
  
  <p>The <code>friend std::array&lt;SomeThing, 64&gt;</code> approach seems like a nice idea, but:</p>
  
  <p>It is going to be used in arrays in other places as well. I would like to guarantee this class to always keep certain invariants towards to external users. With this friendly array, a user can accidentally create an uninitialised array of <code>SomeThing</code>.</p>
  
  <p>Also, the lookup tables are generated using a rather complicated process, can't be done per inline, as in <code>std::array&lt;SomeThing, 64&gt; SomeThing::lookup_table_0(some value)</code></p>