In my cpp proto3 project I am using enums that are wrapped in messages to
avoid namespace collisions.  See for example:

message Physics {
  enum Enum {
     STRUCTURAL = 0;
     THERMAL = 1;

In c++ I can refer to it by Physics::STRUCTURAL which is great.

In this case, the Physics message does not have any fields. It derives from
google::protobuf::Message or MessageLite and has some generated methods
that are not relevant.  In a project with several thousand enums, this
could create binary bloat when compiled.

Does it make sense for protoc to identify messages that are simply there to
wrap enums and provide a lighter api for it?  Or more generally to identify
messages that do not have fields and derive from something even smaller
than MessageLite?

Mohamed Koubaa
Software Developer
Ansys Inc

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 https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to