0
std::deque<std::pair<std::string, std::string>> mFiles;

I have tried a few compare classes without any luck. eg-> the following lambda:

sort(mFiles.begin(), mFiles.end(), [](std::pair<string, string> a, std::pair<string, string> b) {
        //code to ignore case during comparison
        return a<b;
        });

I'm using the following code to sort using the first element of the std::pair:

std::sort(mFiles.begin(), mFiles.end());
volt
  • 1
  • 1
  • 1
    what *"compare classes"* you have tried? – apple apple Nov 10 '21 at 06:27
  • Are you aware that `toupper(a[0]), toupper(b[0]);` are effectively no-ops? 1. It's done on the resp. first char of each string only. 2. `toupper()` is a function (or a function-like macro) which doesn't modify the character in place - you have to assign the result. [toupper()](https://en.cppreference.com/w/cpp/string/byte/toupper) – Scheff's Cat Nov 10 '21 at 07:07

0 Answers0