It depends on what protobuf version you are using. There will be a had_foo() 
for each optional field if you are using protobuf version 2.xx (see C++ 
code reference 
You are out of luck if you are using V3.0 because you will have to create 
your own boolean fields if you need to track whether the optional is 
populated or not.

On Tuesday, March 17, 2015 at 2:09:21 PM UTC-4, s_mitra wrote:
> Hi,
> I have doing some coding related to protobuf where server and client will 
> exchange some info via protobuf.
> In the response object I have multiple optional message objects. 
> How to check which all object is empty and which is not ??

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 post to this group, send email to
Visit this group at
For more options, visit

Reply via email to