Problem accessing static const variables through class member functions
<p>I am having a problem accessing a static const variable defined in my class private member variable section.  Specifically, the code written below can output the variable within the constructor, but when I try to access it through an accessor function, I get an error discussed below.  If anyone knows why I would appreciate your help.</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

class TestStaticVariables
{
 // Private member variable:
 static const double static_double_variable;
public:
 // Constructor:
 TestStaticVariables()
 {
  // Initialization:
  static const double static_double_variable = 20.0;
  cout &lt;&lt; static_double_variable;
 }
 // Member Function:
 void test();
};

void TestStaticVariables::test()
{
</code></pre>

<p>When this next line is uncommented I get the following error message:</p>

<p>Line Location Tool:0: "TestStaticVariables::static_double_variable", referenced from:</p>

<pre><code> //cout &lt;&lt; static_double_variable;
}

int main(int argc, char* const argv[])
{

 TestStaticVariables test_instance;

 return 0;
}
</code></pre>
