fork(1) download
  1. #include <strings.h>
  2. #include <map>
  3. #include <vector>
  4. #include <iostream>
  5. using namespace std;
  6.  
  7. int main() {
  8. auto comp = [](const std::string& s1, const std::string& s2) {
  9. return strcasecmp(s1.c_str(), s2.c_str()) < 0;
  10. };
  11. std::map<std::string, std::vector<std::string>, decltype(comp)> directory(comp);
  12.  
  13. directory["TeSt"] = { "VectorElement" };
  14.  
  15. if (directory.find("TEST") != end(directory))
  16. std::cout << "Entry found." << std::endl;
  17. else
  18. std::cout << "Entry not found!" << std::endl;
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Entry found.