I am using Protobuf3 and I need to create a list of map.
I thought I can use repeated map<string, string> but seems like I cannot.
What should I use instead?
thanks
Essentially, map<...> is identical to:
repeated TypedPair ...
with
message TypedPair {
KeyType key = 1;
ValueType value = 2;
}
So repeated map<...> would be repeated repeated TypedPair which doesn't make sense.
Instead, define a type that has a map, and use that:
message HazMap {
map<...> map = 1;
}
...
repeated HazMap maps = 1;
Could this be implicit? Perhaps - but it isn't right now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With