diff --git a/base/buffer_vector.hpp b/base/buffer_vector.hpp index ca31a9f65d..cee3ab2175 100644 --- a/base/buffer_vector.hpp +++ b/base/buffer_vector.hpp @@ -257,12 +257,5 @@ inline bool operator!=(buffer_vector const & v1, buffer_vector con template inline bool operator<(buffer_vector const & v1, buffer_vector const & v2) { - const size_t N = std::min(v1.size(), v2.size()); - for (size_t i = 0; i < N; ++i) - { - if (!(v1[i] == v2[i])) - return v1[i] < v2[i]; - } - - return ((v1.size() != v2.size()) && (v1.size() == N)); + return lexicographical_compare(v1.begin(), v1.end(), v2.begin(), v2.end()); } diff --git a/std/algorithm.hpp b/std/algorithm.hpp index a570667e5f..6f5bbc8bb9 100644 --- a/std/algorithm.hpp +++ b/std/algorithm.hpp @@ -8,6 +8,7 @@ #include using std::equal; +using std::lexicographical_compare; using std::lower_bound; using std::max; using std::max_element;