How can I set two kind of comparator (one for insert, one for find) on this multiset?
问题 I have declared this STL multiset : multiset<IMidiMsgExt, IMidiMsgExtComp> playingNotes; and my comparator is: struct IMidiMsgExtComp { bool operator()(const IMidiMsgExt& lhs, const IMidiMsgExt& rhs) { return lhs.mTick < rhs.mTick; } }; and this serves to me well on .insert : playingNotes.insert(midiMessage); it inserts (and than orders) the item having the min mTick at the top and the max mTick in the bottom of the list. So its ordered by mTick , and every .begin() will return a IMidiMsgExt