initializing static const member from data file
<p>For the following code:</p>

<pre><code>class A
{
public:
static const int VAL;
};
</code></pre>

<p>I know that I can assign VAL a value in the class declaration:</p>

<pre><code>class A
{
public:
static const int VAL = 3;
};
</code></pre>

<p>or in the CPP file:</p>

<pre><code>const int A::VAL = 3;
</code></pre>

<p>But I would like to read the value in from a data file. I have a function now, let's call it F() which reads in the value I want:</p>

<pre><code>void F()
{
int value = ReadValueFromDataFile();

//But I can't do this:
const int A::VAL = value; //member cannot be defined in the current scope
}
</code></pre>

<p>How can I assign the value of VAL based on a value read in from a data file?</p>
