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
If the compiler doesn't support 64 bit enums by compilation flags or any other means I think there is no solution to this one.
You could create something like in your sample something like:
namespace MyNamespace {
const uint64 LARGE_VALUE = 0x1000000000000000;
};
and using it just like an enum using
MyNamespace::LARGE_VALUE
or
using MyNamespace;
....
val = LARGE_VALUE;