Is it possible to do something like this in C++:
enum A {//Starts from 0 and has no enum with out of place value like 0,1,5,40, etc.
eg1,
eg2,
eg3,
...
}
enum B {//Same structure as enum A
e1,
e2,
e3,
...
}
some_data_type e = eg1;//No errors here
e = e2;//No errors here
I think it could be something like just an integer, but just to be safe is there another way to do this?
eholds, or just the value?intinstead ofsome_data_typestd::variant(orstd::any), then in ONE variable will hard unless you wrap the "one variable" in astruct { enum { enum_A, enum_B } which; union { A a; B b; } value; } enum_value;