summaryrefslogtreecommitdiffstats
path: root/src/concurrent/qtconcurrentmap.h
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2020-10-12 11:55:40 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2020-10-12 13:52:01 +0200
commit605bbe2011f99f4a9036cbd41cd5a05fd3108070 (patch)
tree3d7bc870e40ca557ae2f1b756aeeb32a7a13f666 /src/concurrent/qtconcurrentmap.h
parent306931349296747eeb469e29908e2ab589de89fd (diff)
Make QtConcurrent docs more readable
- Replaced 'auto' keyword in function signatures by the actual return type. - Fixed signatures to not include enable_if statements. Change-Id: I7292e8e506fd50d22974a86448fa4e85e8f08dfb Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/concurrent/qtconcurrentmap.h')
-rw-r--r--src/concurrent/qtconcurrentmap.h81
1 files changed, 80 insertions, 1 deletions
diff --git a/src/concurrent/qtconcurrentmap.h b/src/concurrent/qtconcurrentmap.h
index 2b475dced1..29ab364e77 100644
--- a/src/concurrent/qtconcurrentmap.h
+++ b/src/concurrent/qtconcurrentmap.h
@@ -105,9 +105,14 @@ QFuture<ResultType> mappedReduced(Sequence &&sequence,
(QThreadPool::globalInstance(), std::forward<Sequence>(sequence), map, reduce, options);
}
+#ifdef Q_CLANG_QDOC
+template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor,
+ typename InitialValueType>
+#else
template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
QFuture<ResultType> mappedReduced(QThreadPool *pool,
Sequence &&sequence,
MapFunctor map,
@@ -120,10 +125,14 @@ QFuture<ResultType> mappedReduced(QThreadPool *pool,
pool, std::forward<Sequence>(sequence), map, reduce,
ResultType(std::forward<InitialValueType>(initialValue)), options);
}
-
+#ifdef Q_CLANG_QDOC
+template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor,
+ typename InitialValueType>
+#else
template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
QFuture<ResultType> mappedReduced(Sequence &&sequence,
MapFunctor map,
ReduceFunctor reduce,
@@ -162,10 +171,15 @@ QFuture<ResultType> mappedReduced(
(QThreadPool::globalInstance(), std::forward<Sequence>(sequence), map, reduce, options);
}
+#ifdef Q_CLANG_QDOC
+template <typename Sequence, typename MapFunctor, typename ReduceFunctor, typename ResultType,
+ typename InitialValueType>
+#else
template <typename Sequence, typename MapFunctor, typename ReduceFunctor,
typename ResultType = typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
QFuture<ResultType> mappedReduced(QThreadPool *pool,
Sequence &&sequence,
MapFunctor map,
@@ -179,10 +193,15 @@ QFuture<ResultType> mappedReduced(QThreadPool *pool,
ResultType(std::forward<InitialValueType>(initialValue)), options);
}
+#ifdef Q_CLANG_QDOC
+template <typename Sequence, typename MapFunctor, typename ReduceFunctor, typename ResultType,
+ typename InitialValueType>
+#else
template <typename Sequence, typename MapFunctor, typename ReduceFunctor,
typename ResultType = typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
QFuture<ResultType> mappedReduced(Sequence &&sequence,
MapFunctor map,
ReduceFunctor reduce,
@@ -221,9 +240,14 @@ QFuture<ResultType> mappedReduced(Iterator begin,
(QThreadPool::globalInstance(), begin, end, map, reduce, options);
}
+#ifdef Q_CLANG_QDOC
+template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor,
+ typename InitialValueType>
+#else
template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
QFuture<ResultType> mappedReduced(QThreadPool *pool,
Iterator begin,
Iterator end,
@@ -238,9 +262,14 @@ QFuture<ResultType> mappedReduced(QThreadPool *pool,
ResultType(std::forward<InitialValueType>(initialValue)), options);
}
+#ifdef Q_CLANG_QDOC
+template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor,
+ typename InitialValueType>
+#else
template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
QFuture<ResultType> mappedReduced(Iterator begin,
Iterator end,
MapFunctor map,
@@ -281,10 +310,15 @@ QFuture<ResultType> mappedReduced(Iterator begin,
(QThreadPool::globalInstance(), begin, end, map, reduce, options);
}
+#ifdef Q_CLANG_QDOC
+template <typename Iterator, typename MapFunctor, typename ReduceFunctor, typename ResultType,
+ typename InitialValueType>
+#else
template <typename Iterator, typename MapFunctor, typename ReduceFunctor,
typename ResultType = typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
QFuture<ResultType> mappedReduced(QThreadPool *pool,
Iterator begin,
Iterator end,
@@ -299,10 +333,15 @@ QFuture<ResultType> mappedReduced(QThreadPool *pool,
options);
}
+#ifdef Q_CLANG_QDOC
+template <typename Iterator, typename MapFunctor, typename ReduceFunctor, typename ResultType,
+ typename InitialValueType>
+#else
template <typename Iterator, typename MapFunctor, typename ReduceFunctor,
typename ResultType = typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
QFuture<ResultType> mappedReduced(Iterator begin,
Iterator end,
MapFunctor map,
@@ -415,9 +454,14 @@ ResultType blockingMappedReduced(Sequence &&sequence,
return future.takeResult();
}
+#ifdef Q_CLANG_QDOC
+template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor,
+ typename InitialValueType>
+#else
template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
ResultType blockingMappedReduced(QThreadPool *pool,
Sequence &&sequence,
MapFunctor map,
@@ -433,9 +477,14 @@ ResultType blockingMappedReduced(QThreadPool *pool,
return future.takeResult();
}
+#ifdef Q_CLANG_QDOC
+template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor,
+ typename InitialValueType>
+#else
template <typename ResultType, typename Sequence, typename MapFunctor, typename ReduceFunctor,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
ResultType blockingMappedReduced(Sequence &&sequence,
MapFunctor map,
ReduceFunctor reduce,
@@ -479,10 +528,15 @@ ResultType blockingMappedReduced(Sequence &&sequence,
return future.takeResult();
}
+#ifdef Q_CLANG_QDOC
+template <typename MapFunctor, typename ReduceFunctor, typename Sequence, typename ResultType,
+ typename InitialValueType>
+#else
template <typename MapFunctor, typename ReduceFunctor, typename Sequence,
typename ResultType = typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
ResultType blockingMappedReduced(QThreadPool *pool,
Sequence &&sequence,
MapFunctor map,
@@ -498,10 +552,15 @@ ResultType blockingMappedReduced(QThreadPool *pool,
return future.takeResult();
}
+#ifdef Q_CLANG_QDOC
+template <typename MapFunctor, typename ReduceFunctor, typename Sequence, typename ResultType,
+ typename InitialValueType>
+#else
template <typename MapFunctor, typename ReduceFunctor, typename Sequence,
typename ResultType = typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
ResultType blockingMappedReduced(Sequence &&sequence,
MapFunctor map,
ReduceFunctor reduce,
@@ -546,9 +605,14 @@ ResultType blockingMappedReduced(Iterator begin,
return future.takeResult();
}
+#ifdef Q_CLANG_QDOC
+template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor,
+ typename InitialValueType>
+#else
template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
ResultType blockingMappedReduced(QThreadPool *pool,
Iterator begin,
Iterator end,
@@ -565,9 +629,14 @@ ResultType blockingMappedReduced(QThreadPool *pool,
return future.takeResult();
}
+#ifdef Q_CLANG_QDOC
+template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor,
+ typename InitialValueType>
+#else
template <typename ResultType, typename Iterator, typename MapFunctor, typename ReduceFunctor,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
ResultType blockingMappedReduced(Iterator begin,
Iterator end,
MapFunctor map,
@@ -614,10 +683,15 @@ ResultType blockingMappedReduced(Iterator begin,
return future.takeResult();
}
+#ifdef Q_CLANG_QDOC
+template <typename Iterator, typename MapFunctor, typename ReduceFunctor, typename ResultType,
+ typename InitialValueType>
+#else
template <typename Iterator, typename MapFunctor, typename ReduceFunctor,
typename ResultType = typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
ResultType blockingMappedReduced(QThreadPool *pool,
Iterator begin,
Iterator end,
@@ -634,10 +708,15 @@ ResultType blockingMappedReduced(QThreadPool *pool,
return future.takeResult();
}
+#ifdef Q_CLANG_QDOC
+template <typename Iterator, typename MapFunctor, typename ReduceFunctor, typename ResultType,
+ typename InitialValueType>
+#else
template <typename Iterator, typename MapFunctor, typename ReduceFunctor,
typename ResultType = typename QtPrivate::ReduceResultType<ReduceFunctor>::ResultType,
typename InitialValueType,
std::enable_if_t<std::is_convertible_v<InitialValueType, ResultType>, int> = 0>
+#endif
ResultType blockingMappedReduced(Iterator begin,
Iterator end,
MapFunctor map,