M
Marc Gravell
This one stumped me while refactoring some code to use generics...
Suppose I declare an enum MyEnum {...}
Is there a good reason why MyEnum doesn't implement IEquatable<MyEnum> ?
Of course, I can cast a MyEnum instance down to the int / short whatever
(since int implements IEquatable<int>), but I don't like doing that, as it
feels a bit messy, and I am then propegating the things that know what the
base represenation is...
Am I missing something? Is this just an oversight?
(For ref, I am using IEquatable<T> to avoid having to use == since operators
cannot be expressed in the delegate declaration).
Marc
Suppose I declare an enum MyEnum {...}
Is there a good reason why MyEnum doesn't implement IEquatable<MyEnum> ?
Of course, I can cast a MyEnum instance down to the int / short whatever
(since int implements IEquatable<int>), but I don't like doing that, as it
feels a bit messy, and I am then propegating the things that know what the
base represenation is...
Am I missing something? Is this just an oversight?
(For ref, I am using IEquatable<T> to avoid having to use == since operators
cannot be expressed in the delegate declaration).
Marc