diff --git a/util/string_compare.hh b/util/string_compare.hh new file mode 100644 index 0000000..91d7393 --- /dev/null +++ b/util/string_compare.hh @@ -0,0 +1,10 @@ +#pragma once +#include +#include +#include + +//case insensitive less +constexpr bool less_ci(std::string_view a, std::string_view b) { + return std::ranges::lexicographical_compare( + a, b, [](const char char1, const char char2) { return std::tolower(char1) < std::tolower(char2); }); +}