Hi,
I have messages defined as:

message MsgHeader
{
  required EMessages  opCode        = 1;
  required int32      sessionRef    = 2;
  optional int32      transactionId = 3 [default = 0];
  optional int32      status        = 4 [default = 0];
}

message MSG_EVENT_METHOD_STATUS
{
  optional EMessages    opCode      = 1 [default = 
E_MSG_EVENT_METHOD_STATUS];
  required EMessages    opCodeSent  = 2;
  required MsgHeader    header      = 3;
}

In my code, when I wanna set the header params, I get the compiler error 
C2662 because the header() method is const.
So I cannot do something like:

MSG_EVENT_METHOD_STATUS msg;
msg.header().set_status(0);

Is there a way to avoid this or I have to make a const_cast on the header()?

BR,
Daniele.

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to