c++中 map.contrains 函数有人用过吗
在使用时显示不存在此方法,难道是 c++版本不对
#include <iostream> #include <map>
int main() { std::map<int,char> example = {{1,'a'},{2,'b'}};
if(example.contains(2)) { std::cout << "Found\n"; } else { std::cout << "Not found\n"; } }
