|
Space Engineers
|
A fast and efficient implementation of IEqualityComparer{T} for Enum types. Useful for dictionaries that use Enums as their keys. More...
Public Member Functions | |
| bool | Equals (TEnum x, TEnum y) |
| Determines whether the specified objects are equal. More... | |
| int | GetHashCode (TEnum obj) |
| Returns a hash code for the specified object. More... | |
| int | Compare (TEnum x, TEnum y) |
Properties | |
| static EnumComparer< TEnum > | Instance [get] |
| The singleton accessor. More... | |
A fast and efficient implementation of IEqualityComparer{T} for Enum types. Useful for dictionaries that use Enums as their keys.
var dict = new Dictionary<DayOfWeek, string>(EnumComparer<DayOfWeek>.Instance);
| TEnum | The type of the Enum. |
| TEnum | : | struct | |
| TEnum | : | IComparable | |
| TEnum | : | IConvertible | |
| TEnum | : | IFormattable |
Definition at line 17 of file EnumComparer.cs.
|
inline |
Definition at line 199 of file EnumComparer.cs.
|
inline |
Determines whether the specified objects are equal.
| x | The first object of type TEnum to compare. |
| y | The second object of type TEnum to compare. |
Definition at line 82 of file EnumComparer.cs.
|
inline |
Returns a hash code for the specified object.
| obj | The T:System.Object for which a hash code is to be returned. |
| T:System.ArgumentNullException | The type of obj is a reference type and obj is null. |
Definition at line 98 of file EnumComparer.cs.
|
staticget |
The singleton accessor.
Definition at line 65 of file EnumComparer.cs.
1.8.8