C# Enums with Flags Attribute

后端 未结 4 1054
难免孤独
难免孤独 2021-02-14 09:54

I was wondering if Enums with Flag attribute are mostly used for Bitwise operations why not the compilers autogenerate the values if the enum values as not defined.

For

4条回答
  •  不思量自难忘°
    2021-02-14 10:33

    They probably could, but with a compiler of this size they have to take into consideration the time and resources required to implement something vs the potential benefit, especially with syntactic sugar like this. And it is just syntactic sugar because you can write it manually.

提交回复
热议问题