Comment #3 on issue 332 by Allow for default values that are marked "set"

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
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to