Hi,
When using a repeated enum field, For example:
enum Bar {
BAR_VALUE = 0;
OTHER_VALUE = 1;
}
message test {
repeated Bar foo = 1;
}
I will get c++ accessor methods like this (see here).
<https://developers.google.com/protocol-buffers/docs/reference/cpp-generated>
Bar foo(int index) const
const RepeatedField
<https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.repeated_field>
<int>& foo() const
However I am wondering why the RepeatedField template is instantiated with
"int" and not the enum type "Bar".
This prevents me from using interators to iterate through the fields (I try
to avoid enum casting).
1. Why is the generated interface like this?
2. What is the recommended way for iterating through repeated enum fields?
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.