template class of static const member variable vs static const member variable initialization
<p>below code compiled fine</p>

<pre><code>template&lt;typename T&gt;
struct foo
{
    static const T value = 1 + foo::value;
};
</code></pre>

<p>but this one is error</p>

<pre><code>struct foo
{
    static const int value = 1 + foo::value;
};
</code></pre>

<p>and also</p>

<pre><code>template&lt;typename T&gt;
struct foo
{
     static const int value = 1 + foo::value;
};

Error   1   error C2065: 'value' : undeclared identifier    c:\visual studio 2013\projects\consoleapplication2\consoleapplication2\consoleapplication2.cpp  13  1   ConsoleApplication2
</code></pre>

<p>i think second case is reasonable anyway</p>

<p>but first one is how it works?</p>

<p>can someone explain this?</p>