std map composite key
问题 I have a problem with the operator<() method which is required for a std::map. I'm using a struct as composite key that looks as follows: struct MyKey { std::string string1; std::string string2; std::string string3; unsigned int uint1; friend bool operator<(const MyKey& mk1, const MyKey& mk2) { return mk1.string1 < mk2.string1 && mk1.string2 < mk2.string2 && mk1.string3 < mk2.string3 && mk1.uint1 < mk2.uint1; } } As introduced I want to use a composite key with 4 values, but I don't know how