1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include <string> #include <algorithm> namespace xmrstak { bool strcmp_i(const std::string& str1, const std::string& str2) { if(str1.size() != str2.size()) return false; else return (str1.empty() | str2.empty()) ? false : std::equal(str1.begin(), str1.end(),str2.begin(), [](char c1, char c2) { return ::tolower(c1) == ::tolower(c2); } ); } } // namepsace xmrstak