[protobuf] Re: Question about set_allocated_foo/release_foo

2013-03-14 Thread Kevin Regan
Giving this a bump. This might also be considered a feature request (the ability to temporarily assign a string value to a protocol buffer during serialization, rather than copying it). --Kevin On Friday, March 8, 2013 1:49:29 PM UTC-8, Kevin Regan wrote: I often have situations like this:

Re: [protobuf] Re: Question about set_allocated_foo/release_foo

2013-03-14 Thread Feng Xiao
A better solution should be to refactor your code a little bit to pass in a mutable string object directly. You can expect protos to take movable objects in the future, but even when that happens you will still need to refactor your code. I don't think we will change protobuf to share references

Re: [protobuf] Re: Question about set_allocated_foo/release_foo

2013-03-14 Thread Kevin Regan
It is very common to have a const std::string argument. Indeed, just about any API that you would export to the end user would probably support taking aconst std::string key in this case. --Kevin On Thursday, March 14, 2013 6:31:54 PM UTC-7, Feng Xiao wrote: A better solution should be to