title: initialize a const array in a class initializer in C++
body: <p>I have the following class in C++:</p>
  
  <pre><code>class a {
      const int b[2];
      // other stuff follows
  
      // and here's the constructor
      a(void);
  }
  </code></pre>
  
  <p>The question is, how do I initialize b in the initialization list, given that I can't initialize it inside the body of the function of the constructor, because b is <code>const</code>?</p>
  
  <p>This doesn't work:</p>
  
  <pre><code>a::a(void) : 
      b([2,3])
  {
       // other initialization stuff
  }
  </code></pre>
  
  <p>Edit:  The case in point is when I can have different values for <code>b</code> for different instances, but the values are known to be constant for the lifetime of the instance.</p>