C# supports Enum Flags, which is a nice feature.

>    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 
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?

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to