这个问题在这里已有答案: 如何在C#中枚举枚举? 26个答案
public enum Foos { A, B, C }
有没有办法循环可能的值Foos?
Foos
基本上?
foreach(Foo in Foos)
.net c# enums language-features
我只是注意到你不能在枚举上使用标准数学运算符,如++或+ =
那么迭代C++枚举中所有值的最佳方法是什么?
c++ enums
enums ×2
.net ×1
c# ×1
c++ ×1
language-features ×1