C# supports Enum Flags, which is a nice feature.
[Flags]
enum MyColor
{
None = 0,
Black = 1,
Red = 2,
Green = 4,
Blue = 8
};
However, protobuf seems doesn't support it. There is no way to define a Flags for an enum.
Also, for protobuf2, it seem current implementation is forbidden values that are combinations (e.g. 3). In that case it will treat it like unknown fields.
In current protobuf 3 c# implemention, the restriction seems gets removed. However, there is still no way to define the enum as Flags.
In Java we also have EnumSet to give similar functionality.
Will Protobuf C# implementation support this in the future?