struct DistancePair { unsigned int first; string second; DistancePair() : first(0) { } DistancePair(unsigned int f, string & s) : first(f), second(s) { } }; bool operator < (DistancePair & lhs, DistancePair & rhs) { return lhs.first < rhs.first; }