diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2013-09-14 19:52:18 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-14 23:43:00 +0200 |
commit | f4cc344e01e00e640bce10f03c47b25d19c3e7fc (patch) | |
tree | 0744008310e0f9b33f1b7c7e1409c4ef5fc845da /src/corelib/tools | |
parent | 7d7e8ae3fa79b06c916de1a7a10eed63611c5d25 (diff) |
Revert "Reimplement qBinaryFind in terms of std::lower_bound"
After a bit of discussion, we should actually deprecate qBinaryFind too.
This puts the old code back (to avoid behavior changes / source
breaks).
This reverts commit 23d7f6ee5dea3dd9f47f4ab538b25dc0ffe3df92.
Task-number: QTBUG-33473
Change-Id: I7f7d25171e14061e51543c501c30a7b6b184a8fd
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qalgorithms.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h index 3bd3812e78..8337afcb9d 100644 --- a/src/corelib/tools/qalgorithms.h +++ b/src/corelib/tools/qalgorithms.h @@ -43,7 +43,6 @@ #define QALGORITHMS_H #include <QtCore/qglobal.h> -#include <algorithm> QT_BEGIN_NAMESPACE @@ -293,7 +292,7 @@ template <typename RandomAccessIterator, typename T> Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value) { // Implementation is duplicated from QAlgorithmsPrivate. - RandomAccessIterator it = std::lower_bound(begin, end, value); + RandomAccessIterator it = qLowerBound(begin, end, value); if (it == end || value < *it) return end; @@ -507,7 +506,7 @@ Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBoundHelper(RandomAccessIterator template <typename RandomAccessIterator, typename T, typename LessThan> Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan) { - RandomAccessIterator it = std::lower_bound(begin, end, value, lessThan); + RandomAccessIterator it = qLowerBoundHelper(begin, end, value, lessThan); if (it == end || lessThan(value, *it)) return end; |