What is the correct usage of StringValue in C++.
google::protobuf::StringValue* test = new google::protobuf::StringValue();
test->set_value("some string");
someRequest.set_allocated_value(test);
Do i have to delete the StringValue manually at the end? Why this isn't possible?
std::unique_ptr<google::protobuf::StringValue> test (new google::protobuf::StringValue());
test.get()->set_value("some string");
someRequest.set_allocated_value(test.get());
When i use a smartpointer i got errors when the destructor of the request is called. And why in the request i only have these "set_allocated_value" functions and not just "set_value"?
And one more thing, why there are no examples for StringValue. Also the official c++ documentation of protobuf is using string instead of StringValue.