why aren't instances of strongly typed C++0x enumerations comparable to each other?
Update: They are comparable in gcc 4.6; I'm not sure if it worked in gcc 4.4.
If you use strongly typed enumerations, it's like making your enum a realy type, a class. Then it follows the same rules as for classes.
Instances of different classes can't be compared to each other by default. You have to define a comparison function (or member function) to make them comparable.
Therefore making an enumeration strongly typed makes it follows this very same rule.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With