<p>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 causes the compiler to error.</p>

<p>For some reason I thought the following might work:</p>

<pre><code>enum MY_ENUM : unsigned __int64  
{  
    LARGE_VALUE = 0x1000000000000000,  
};
</code></pre>

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.