diff --git a/src/corelib/tools/qminimalflatset_p.h b/src/corelib/tools/qminimalflatset_p.h index 0798aa7a985..c6466cf3617 100644 --- a/src/corelib/tools/qminimalflatset_p.h +++ b/src/corelib/tools/qminimalflatset_p.h @@ -29,6 +29,7 @@ #endif #include // for std::lower_bound +#include // for std::less QT_BEGIN_NAMESPACE @@ -120,8 +121,10 @@ private: bool exists; }; - const auto it = std::lower_bound(c.cbegin(), c.cend(), v); - return R{it, it != c.cend() && !(v < *it)}; + auto cmp = std::less{}; + + const auto it = std::lower_bound(c.cbegin(), c.cend(), v, cmp); + return R{it, it != c.cend() && !cmp(v, *it)}; } #ifdef QMINIMAL_FLAT_SET_DEBUG