tags:

views:

59

answers:

1

why aren't strongly typed C++0x enumerations comparable to each other?

+5  A: 

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.

Classes instances can't be compared to each other. You have to define a comparison function (or member function) to make them comparable.

Then making an enumeration strongly typed makes it follows this very rule.

Klaim