Comment #3 on issue 332 by ryan.br...@themoox.net: Allow for default values that are marked "set"
http://code.google.com/p/protobuf/issues/detail?id=332

Sorry, I should have specified what language I'm working in. I'm using C++ for this (2.4.0a), so it's related to code generated from protoc.

Essentially I have a field "required int topic = 1 [default = ???];" at the beginning of each of my protobuf messages.

What I am trying to achieve is:
    _has_bits_[0] = 1 upon instantiation or clear of a message
    clear_has_topic() does nothing

From what I can gather from Issue protobuf-net:199, UseImplicitZeroDefaults isn't *quite* what I'm looking for. Issue 249 suggests that marking the field as "required" still forces me to manually set it before I can serialize the message... making "default"s behavior limited to the receiver of the protobuf. I'm looking/hoping for a "send" default for the values specified in the .proto file.

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to protobuf@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