summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/tools/qarraydataops.h14
-rw-r--r--src/corelib/tools/qlist.h11
2 files changed, 9 insertions, 16 deletions
diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h
index 68a536004f..0de0c1df75 100644
--- a/src/corelib/tools/qarraydataops.h
+++ b/src/corelib/tools/qarraydataops.h
@@ -911,17 +911,13 @@ public:
Q_ASSERT(distance >= 0 && distance <= this->allocatedCapacity() - this->size);
Q_UNUSED(distance);
-#if __cplusplus >= 202002L
- constexpr bool canUseCopyAppend = std::conjunction_v<
- std::is_convertible<
- typename std::iterator_traits<It>::iterator_category,
- std::contiguous_iterator_tag
- >,
- std::is_same<
+#if __cplusplus >= 202002L && defined(__cpp_concepts) && defined(__cpp_lib_concepts)
+ constexpr bool canUseCopyAppend =
+ std::contiguous_iterator<It> &&
+ std::is_same_v<
std::remove_cv_t<typename std::iterator_traits<It>::value_type>,
T
- >
- >;
+ >;
if constexpr (canUseCopyAppend) {
this->copyAppend(std::to_address(b), std::to_address(e));
} else
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 8a2b542357..aaa2a950dd 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -147,12 +147,10 @@ public:
using value_type = T;
// libstdc++ shipped with gcc < 11 does not have a fix for defect LWG 3346
#if __cplusplus >= 202002L && (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 11)
- using iterator_category = std::contiguous_iterator_tag;
+ using iterator_concept = std::contiguous_iterator_tag;
using element_type = value_type;
-#else
- using iterator_category = std::random_access_iterator_tag;
#endif
-
+ using iterator_category = std::random_access_iterator_tag;
using pointer = T *;
using reference = T &;
@@ -220,11 +218,10 @@ public:
using value_type = T;
// libstdc++ shipped with gcc < 11 does not have a fix for defect LWG 3346
#if __cplusplus >= 202002L && (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 11)
- using iterator_category = std::contiguous_iterator_tag;
+ using iterator_concept = std::contiguous_iterator_tag;
using element_type = const value_type;
-#else
- using iterator_category = std::random_access_iterator_tag;
#endif
+ using iterator_category = std::random_access_iterator_tag;
using pointer = const T *;
using reference = const T &;