Standard C++ containers provide lexicographical comparison through the standard set of comparison operators (before C++20) and the three-way comparison operator (since C++20).
The support covers std::array, std::vector, std::deque, std::(forward_)list, std::string (and variants), std::(multi)set, std::(multi)map, std::stack and std::queue.
Compiler Explorer link: https://compiler-explorer.com/z/Tar5TTKna
@simontoth I never know you can do that for containers other than std::string! And I used std::lexicographical_compare and friends for this purpose before
@lesley Yeah, it's not a super obvious feature.
One thing I love about doing these daily bites, I get to properly explore the weird corners of the language.