VS 2005 -> Compilation without any errors.
VS 2010 -> Compilation with any errors.
e.g. code snippet
template< bool f > struct static_assert;
template<> struct static_assert<true> { static_assert() {} };
Compiler Error:
error C2332: 'struct': missing tag name
e.g. code snippet
template< typename T >
class abcd
{
struct xyz
{
xyz();
char c;
T tt;
};
public:
enum { value = sizeof(xyz)-sizeof(T) < sizeof(T) ? sizeof(xyz)-sizeof(T) : sizeof(T) };
};
Compiler Error:
error C2332: 'class': missing tag name
Any suggestions.
In your first code snippet, the problem is that
static_assertbecame a reserved keyword in the C++11 Standard (VS-2010 seems to be using this), whereas it was an 'allowed' identifier in previous versions of the language (such as the VS-2005 compiler was using). To resolve this issue, change the name of your structure, even if that means simply changing the case of one or two letters:I cannot reproduce the issue in your second code snippet (using VS-2010).