On Friday, January 25, 2013 5:39:29 AM UTC+8, Mohit Jaggi wrote: > > Looks like this is the intended way and the type of function I expected is > only supported for basic data types and strings. > Right. add_P(X_t elem) involves a copy of the X_t message which may be very expensive. I think that's it's omitted from the API.
> > > On Thu, Jan 24, 2013 at 1:24 PM, Mohit Jaggi <[email protected]<javascript:> > > wrote: > >> Hi All, >> I have the following IDL code: >> message X_t { >> optional string A = 1; >> optional string B = 2; >> optional uint32 C = 3; >> } >> >> message Y_t { >> repeated X_t P = 1; >> } >> I am expecting to have in the generated CPP code: >> >> void Y_t::add_P(X_t elem) //to append elem to the repeated field P in Y >> >> but instead I see: >> >> X_t Y_t::add_P() //note no param to pass in the element to be added, >> wrong return type. >> { >> P_.Add(); >> } >> >> Is this a bug or am I missing something? >> >> Mohit. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Protocol Buffers" group. >> To post to this group, send email to [email protected]<javascript:> >> . >> To unsubscribe from this group, send email to >> [email protected] <javascript:>. >> Visit this group at http://groups.google.com/group/protobuf?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/protobuf?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
