Comment #8 on issue 60 by mer...@google.com: Support static values in .proto files
http://code.google.com/p/protobuf/issues/detail?id=60

I've been wishing for this once in a while.

There's a workaround: Protobuf actually does have a syntax for literal values: field defaults. So you can define:
message Constants {
  optional string constant = 1 [default = "foo"];
}

and access it as Constants::default_instance().constant();


--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to