Hi, as always I was doing an exercise and faced huge error message when I was trying to sort vector of std::pair<std::string, int> based on values of int
So I'm having this class that's supposed to act like std::map just with a poor implementation. The problem is with my void print() const; function. I want to sort all the vector pairs based on int value but I'm getting giganting error message. I dont really understand what it is about! Funny thing is that I only use this one line in that function std::sort(vec.begin(), vec.end(), Compare{});
If I remove my print function and just randomly try to sort some random vector that I created in main it works super fine. Exactly the same line of codes gives huge error message in one place but works in another. What is going on here?