aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/api
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-10-26 23:00:11 -0700
committerJake Petroules <jake.petroules@qt.io>2017-11-22 16:15:26 +0000
commit9193447cb4f7242816bffde0b6101636632ebd17 (patch)
tree73f7a6a18046b2a9caefd3330c5aaa2f514efb34 /tests/auto/api
parent1445ea6d69146b2c05efbfe142c557f9bf724025 (diff)
STL compatibility: use cbegin/cend() instead of constBegin/constEnd()
Change-Id: I363e4d85e60c1c8ea1c0661d5088a7b8e1a5b806 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests/auto/api')
-rw-r--r--tests/auto/api/tst_api.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/api/tst_api.cpp b/tests/auto/api/tst_api.cpp
index 340c661cd..4c96bd85e 100644
--- a/tests/auto/api/tst_api.cpp
+++ b/tests/auto/api/tst_api.cpp
@@ -1325,10 +1325,10 @@ void TestApi::inheritQbsSearchPaths()
VERIFY_NO_ERROR(errorInfo);
}
-template <typename T, class Pred> T findElem(const QList<T> &list, Pred p)
+template <typename T, class Pred> typename T::value_type findElem(const T &list, Pred p)
{
- const auto it = std::find_if(list.constBegin(), list.constEnd(), p);
- return it == list.constEnd() ? T() : *it;
+ const auto it = std::find_if(list.cbegin(), list.cend(), p);
+ return it == list.cend() ? typename T::value_type() : *it;
}
void TestApi::installableFiles()