Constexpr options access?

58 views
Skip to first unread message

Maxim Sigalov

unread,
Aug 11, 2022, 9:05:09 AM8/11/22
to Protocol Buffers
Hi all -
Is there anyway to access custom options added to fields at compile time?
As I understand it, and from looking at the generated code, it only seems possible to look up Options via an appropriate Descriptor, and I'm not sure it's possible to get a constexpr one?
I'm looking at an EnumValueOptions specifically, and adding a "name" option generates a "name_default" but no constexpr lookup it seems.

If this is not possible, is there any suggested workaround?
Thanks

Jie Luo

unread,
Aug 16, 2022, 4:41:17 PM8/16/22
to Protocol Buffers
Reply all
Reply to author
Forward
0 new messages