How do you iterate through a mutable repeated Proto field in C++ using a range-based for loop?

Viewed 11221

How do you you iterate through a mutable repeated Protocol Buffer field using a range-based for loop in C++?

1 Answers

Use a reference:

for (MyProto &my_proto : *container->mutable_my_protos()) {…}
Related