Re: [protobuf] c++ why no set_allocated for repeated nested messages?

2014-10-03 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Oct 2, 2014 at 8:58 PM, ch...@ochsnet.com wrote:

 Always having to obtain a new instance of a repeated nested message from
 it's parent is really cumbersome.I fail to see the logic behind it
 being that singular message fields have set_allocated.

We can add an add_allocated() method for repeated message fields but that's
not necessary because you can do:
foo-mutable_repeated_message()-AddAllocated(bar);



 Chris

 --
 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.
 For more options, visit https://groups.google.com/d/optout.


-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] c++ why no set_allocated for repeated nested messages?

2014-10-03 Thread chris


On Friday, October 3, 2014 10:51:09 AM UTC-7, Feng Xiao wrote:

 On Thu, Oct 2, 2014 at 8:58 PM, ch...@ochsnet.com javascript: wrote:

 Always having to obtain a new instance of a repeated nested message from 
 it's parent is really cumbersome.I fail to see the logic behind it 
 being that singular message fields have set_allocated.

 We can add an add_allocated() method for repeated message fields but 
 that's not necessary because you can do:
 foo-mutable_repeated_message()-AddAllocated(bar);
  



Thanks for the tip!  Didn't notice that you could do that.

Chris 

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[protobuf] c++ why no set_allocated for repeated nested messages?

2014-10-02 Thread chris
Always having to obtain a new instance of a repeated nested message from 
it's parent is really cumbersome.I fail to see the logic behind it 
being that singular message fields have set_allocated.

Chris

-- 
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.
For more options, visit https://groups.google.com/d/optout.