below code compiled fine
template<typename T>
struct foo
{
static const T value = 1 + foo::value;
};
but this one is error
struct foo
{
static const int value = 1 + foo::value;
};
and also
template<typename T>
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
i think second case is reasonable anyway
but first one is how it works?
can someone explain this?