protocolbuffers / protocolbuffers.github.io

Other
38 stars 107 forks source link

C++ Generated Code Guide oneof #155

Closed Zack-Work closed 1 month ago

Zack-Work commented 2 months ago

In this section: https://protobuf.dev/reference/cpp/cpp-generated/#oneof-numeric and this one: https://protobuf.dev/reference/cpp/cpp-generated/#oneof-enum it refers to the oneof field has<> functions as being Proto2 only. It looks like this may be out of date. I am definitely able to use has functions for numeric types, enum types, and bool types in Proto3 and this stack overflow seems to indicate it was added in 3.15: https://stackoverflow.com/a/66541707

Thanks.

Logofile commented 2 months ago

Thanks for the detailed write-up! I'll work on getting this updated.

Logofile commented 1 month ago

This change removed the reference to the hazzers being proto2-only. Thanks for bringing this to our attention!