How do you have a case insensitive insertion Or search of a string in std::set?
For example-
std::set s; s.insert(\"Hello\"); s.in
You need to define a custom comparator:
struct InsensitiveCompare { bool operator() (const std::string& a, const std::string& b) const { return strcasecmp(a.c_str(), b.c_str()) < 0; } }; std::set s;
You may try stricmp or strcoll if strcasecmp is not available.
stricmp
strcoll
strcasecmp