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


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/3cd5fd1f-7b21-4bd3-9f6c-726255696870%40googlegroups.com.

Reply via email to