we use VS 2008
there is a large listing that is populated by many developers
this enum is of type __int64 (Microsoft extension), and I want the compiler to complain about non-unique values in the enum.
If this were a normal enumeration, I would do the following:
enum E1
{
E11 = 0x01F00,
E12 = 0x01F00,
E13
};
#pragma warning(push)
#pragma warning(error: 4061)
#pragma warning(error: 4062)
void F(E1 e1)
{
switch (e1)
{
case E11:
case E12:
case E13:
return;
}
}
#pragma warning(pop)
and the function F will have an error if E1 has two identical values
and another error would occur if the developer forgot to add a new value to switch
but my enum is of type __int64 (or long long)
and when I try to make the same switch for E1 e1, it cuts off the values and complains about values whose difference is either 0x100000000 or 0x200000000 ....
e1 __int64, , ( )
: - , ? VS VS 2008 ( ++) : __int64 ?