How can I set two kind of comparator (one for insert, one for find) on this multiset?

后端 未结 4 1727
忘了有多久
忘了有多久 2021-01-23 14:48

I have declared this STL multiset:

multiset playingNotes;

and my comparator is:



        
4条回答
  •  佛祖请我去吃肉
    2021-01-23 14:54

    Use std::find_if.

    int value = 60;
    auto iteratorItemFound = std::find_if(std::begin(playingNotes), std::end(playingNotes), [value](const IMidiMsgExt& msg)
    {
        return msg.mNote == value;
    });
    

提交回复
热议问题