I have a .h file :
class MyClass
{
enum MyTypes{
type1 = 1,
type2 = 2,
type3 = 3,
// and so on
};
};
Is it possible to separate the " = value " from this declaration to another location, namely the related cpp file? The reason is that this enumeration has weird values provided by a remote server that I do not control. I would like to remove it from client's eyes.
I'd like to have a .cpp file with
enum MyClass::MyTypes{
type1 = 12,
type2 = 14,
type3 = 28,
// and so on
};
But the compiler says that I redefine MyTypes, which is true.