C++ static initialization: closest match to Java -Dxxx arguments?
<p>I have implemented an algorithm for which there is a strong use-case to know as soon as possible the maximum problem sizes that will be computed during the whole execution of the library so that the required memory (matrices, vectors etc) can be efficiently pre-allocated. "As soon as possible" defined as even earlier or no later than when the C++ static initialization triggers e.g.</p>

<pre><code>  /**
   * Example of what I would like to accomplish but of course this 
   * System#getProperty is the Java way
   */
  class texample {
      static const int MAX_M_N;
  }

  const int texample::MAX_M_N = System.getProperty("maxMN");  // possible? how?
</code></pre>

<p>I could of course do this using dynamic initialization and allocation instead but it will be a lot simpler if these input argument properties are 'seen' during static initialization time. The reason being that the wrapper object instances statically-initialized/allocated will get destructed also by the static destruction process and I won't have to worry about it e.g. handling exceptions and manually freeing/deleting the instances.</p>

<p>UPDATE: and one more thing :) I'd like to have this without having to recompile. I can of course use a macro (I'm using CMake) so it would be very easy to change the macro in the CMakeList.txt file and re-compile but I'd prefer to have the sizes specified dynamically at runtime.</p>
