All I am trying to achieve is to modify a message on the fly with a set of 
fields that are supplied to the program at runtime.

simple case:
// message declared as - const google::protobuf::Message& message
auto x = reflection->GetDouble(message, field);
// do some modification to x
reflection->SetDouble(message, field, x);

my main question is how in the world do I get from a const ref (needed for 
GetDouble() ) to a pointer (needed for SetDouble() )???

I know that if I knew the field name at compile time I would be able to use 
mutable_<name>, but since I don't know that until runtime there does not 
seem to be an easy way to do this. Or I am just missing something super 


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