How to add a message to RepeatedPtrField<Message>

19 views
Skip to first unread message

Jagathish Saravanan

unread,
Jul 28, 2019, 9:06:23 AM7/28/19
to Protocol Buffers
hi , I have an Message , how to add that message to the RepeatedPtrField<Message> in c++. i.e., Adding a new Message to the list of Message.

Adam Cozzette

unread,
Jul 29, 2019, 12:55:16 PM7/29/19
to Jagathish Saravanan, Protocol Buffers
Something like this should work: *(repeated_ptr_field.Add()) = msg;

On Sun, Jul 28, 2019 at 6:06 AM Jagathish Saravanan <jagath...@gmail.com> wrote:
hi , I have an Message , how to add that message to the RepeatedPtrField<Message> in c++. i.e., Adding a new Message to the list of Message.

--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/b8e4e854-a9e6-42b1-864a-8e8c2a810dbe%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages