title: C++ Assign a const value at run-time?
body: <p>I have a constant value that never changes during run-time, but is impossible to know until run-time.</p>
  
  <p>Is there a way to declare a constant (either as a member of a class or not) without defining it and also assign a computed value once (and only once) it is determined; or am I going to have to resort to a non-const declaration and use coding S &amp; Ps (<code>ALL_CAPS</code> variables names, <code>static</code> declaration if in a class, etc.) to <em>try</em> and keep it from changing?</p>
  
  <p>CLARIFICATION:</p>
  
  <p>Though these are good answers, the real-world situation I have is more complicated:</p>
  
  <p>The program has a main loop that continually runs between processing and rendering; the user can set required options and once they are set they will never change until the program is restart. An "Initialize" function is set up for anything that can be determined before the main loop, but values that are dependent on user interaction must be performed in the middle of the loop during the processing phase. (At the moment, persistent data storage techniques come to mind...)</p>