gd-tools/cpr-1.10.5/cpr/cprtypes.cpp
2024-02-07 16:32:30 -04:00

11 lines
374 B
C++

#include "cpr/cprtypes.h"
#include <algorithm>
#include <cctype>
namespace cpr {
bool CaseInsensitiveCompare::operator()(const std::string& a, const std::string& b) const noexcept {
return std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end(), [](unsigned char ac, unsigned char bc) { return std::tolower(ac) < std::tolower(bc); });
}
} // namespace cpr