From 891899dcd48d9151305ea0ffd5eb20993ef0f0e4 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 27 Jun 2016 07:15:08 +0200 Subject: [PATCH] Utils: Fix compile for Qt5.5 Change-Id: I4294fb7dd448e74236e085f7a1884ecedd5a5b90 Reviewed-by: Eike Ziller --- src/libs/utils/algorithm.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libs/utils/algorithm.h b/src/libs/utils/algorithm.h index e08b9ad099c..b1044d26e20 100644 --- a/src/libs/utils/algorithm.h +++ b/src/libs/utils/algorithm.h @@ -424,9 +424,18 @@ inline void sort(Container &c, Predicate p) template inline void reverseForeach(const Container &c, const Op &operation) { +#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) + auto rend = c.begin(); + auto it = c.end(); + while (it != rend) { + --it; + operation(*it); + } +#else auto rend = c.rend(); for (auto it = c.rbegin(); it != rend; ++it) operation(*it); +#endif } }