title: convert variable to const
body: <p>I have an array that i dont know it size till run time. Once the program starts and size is computed, the size won't change.</p>
  
  <p>i tested the following code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;boost/array.hpp&gt;
  #include &lt;cstdint&gt;
  
  int main()
  {
  
      uint32_t num_bits = 12;
      const uint32_t num_elements = 1 &lt;&lt; num_bits;
  
      boost::array&lt;double, num_elements &gt; myArray; //does not work
  
      return 0;
  
  }
  </code></pre>
  
  <p>the following code doesn't work since <code>num_elements</code> is computed. I saw that there are "const_cast" option, but i am not sure if it will solve my problem.</p>
  
  <p>I would apprichiate if there is a boost solution, since i would like to use boost::array.</p>
  
  <p><strong>EDIT</strong>
  <code>num_bits</code> is a parameter which i read from a file, this mean also unknown before run time. I am aware of the solution using std::vector, but access speed is also important, since i access those elements frequently and my simulation takes about 3 days... At the moment i use simply array (new and delete)  </p>