When I use a strongly typed enum in VS2010, for example:
enum eTest : long long
{
_test1 = 0x0000000000000001,
_test2 = 0x0000000000000002,
};
I get this warning:
http://msdn.microsoft.com/en-us/library/ms173702.aspx
nonstandard extension used: specifying underlying type for enum ‘enum’
Why is this? I thought VS2010 supported C++11? Also is a 64bit based enum safe between 64-32bit VS2010 compilers?
Edit:
Regarding the second part of my question: I asked about the 32 vs 64bit because OR’ing bit flags from a 64bit enum when targeting 32bit resulted in compiler errors. However I found out that the reason for is is because enabling Microsoft’s Code Analysis causes this to break.
C++11 enums are done like this:
See Strongly Type Enumerations
[EDIT:] And I believe VS 2010 does not have the compiler that supports this. I think C++11 enums were only partially supported in the MSVC++ 10 Compiler
As far as sizes: check out this page that talks about sizes of data types. Microsoft doesn’t vary much between the 32 and 64 bit versions of their compiler.