msoucy / dproto

D Protocol Buffer mixins to create structures at compile time
Boost Software License 1.0
37 stars 16 forks source link

is there an equivalent of MergeFrom in dproto? #109

Open timotheecour opened 7 years ago

timotheecour commented 7 years ago

https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message

if not, could that be on the roadmap?

for reference: see also https://github.com/google/protobuf/issues/3106#issuecomment-302232227

msoucy commented 7 years ago

Take a look at 76f074e, I added an implementation with some basic testing.

timotheecour commented 7 years ago

awesome! btw, google's MergeFrom appends for repeated fields, which is kind of a silly default, how about adding an option to control whether repeated fields are appended or replaced if defined on the 2nd message?

msoucy commented 7 years ago

I have some other stuff on my plate at the moment, but it should be straightforward to add now that the framework for it is there.