How can you enumerate an enum in C#?
enum
E.g. the following code does not compile:
public enum Suit {
foreach (Suit suit in (Suit[]) Enum.GetValues(typeof(Suit))) { }
Note: The cast to (Suit[]) is not strictly necessary, but it does make the code 0.5 ns faster.
(Suit[])