Hi all,
I am looking for some guidance what would be the best way to define a member of a oneof field where the actual value of the member does not matter and it is sufficient to know that it was selected.
A somewhat contrived example:
message SearchRequest {
oneof options {
ValueDoesNotMatter search_all = 1;
ValueDoesNotMatter search_starred = 2;
string search_named = 3;
}
}
My first choice would be an empty message like google.protobuf.Empty, but it seems that in C++ it is somewhat cumbersome to select that member:
message.mutable_options().set_allocated_search_all(new google::protobuf::Empty);
I thought maybe I am doing it wrong and there is a better way?
Thanks,
Maxim