Daily bit(e) of C++ | std::lexicographical_compare(_three_way)
Daily bit(e) of C++ ♻️241, Comparing ranges lexicographically using std::lexicographical_compare(_three_way).
All C++ containers (except for unordered containers) directly support lexicographical comparison (three-way since C++20) of their content against another instance of the same container.
With the std::lexicographical_compare and std::lexicographical_compare_three_way (C++20), we can compare any input ranges.
std::lexicographical_compare supports both a C++17 paralel and C++20 range version.