title: How to use static const struct from a class as a real const - i.e. an array size
body: <p>I was asked to provide solution for the following problems:</p>
  
  <p>There is a structure defining some int parameters:</p>
  
  <pre><code>struct B {
    int a;
    int b;
  };
  </code></pre>
  
  <p>One wanted to define this structure as const static members in other classes <strong>(not only for this <code>class A</code> - there are other classes expected to have the same set of constants)</strong> .</p>
  
  <p>And one wanted to use them as real integral constants:</p>
  
  <pre><code>// .h file
  class A {
  public:
    static const B c; // cannot initialize here - this is not integral constant
  };
  // .cpp file
  const B A::c = {1,2};
  </code></pre>
  
  <p>But cannot use this constant to make for example an array:</p>
  
  <pre><code>float a[A::c.a];
  </code></pre>
  
  <p>Any advice?</p>