How to find if an element is in a STL map container, defined as below ?
map
#include <map> #include <string> using std::map, std::string; map<string, int> dico = { {"CPU", 10}, {"GPU", 15}, {"RAM", 20} };
dico.find("CPU") != dico.end()
"CPU" in dico
find(dico.begin(), dico.end(), "CPU")
dico.find("CPU") != nullptr