Protobufs provide the RepeatedPtr interface with mutable_ * methods, which can be sorted using the std :: sort () pattern.
If the basic type of a repeating field is simple, you will most likely want to use the overloaded <, compator, or lambda operator for this. Example toy using lambda:
message StaffMember { optional string name = 1; optional double hourly_rate = 2; } message StoreData { repeated StaffMember staff = 1; } StoreData store;
Gavin duggan
source share