Is there a way to have a 64 bit enum in C++? Whilst refactoring some code I came across bunch of #defines which would be better as an enum, but being greater than 32 bit ca
An enum in C++ can be any integral type. You can, for example, have an enum of chars. IE:
enum MY_ENUM
{
CHAR_VALUE = 'c',
};
I would assume this includes __int64. Try just
enum MY_ENUM
{
LARGE_VALUE = 0x1000000000000000,
};
According to my commenter, sixlettervariables, in C the base type will be an int always, while in C++ the base type is whatever is large enough to fit the largest included value. So both enums above should work.