summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qarraydataops.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qarraydataops.h')
-rw-r--r--src/corelib/tools/qarraydataops.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h
index 9e205815c7a..f1771c70d56 100644
--- a/src/corelib/tools/qarraydataops.h
+++ b/src/corelib/tools/qarraydataops.h
@@ -941,7 +941,9 @@ public:
}
}
- if constexpr (!std::is_nothrow_constructible_v<T, decltype(std::invoke(proj, *first))>) {
+ if constexpr (!std::is_nothrow_constructible_v<T, decltype(std::invoke(proj, *first))>
+ || !std::is_nothrow_invocable_v<Projection, decltype(*first)>)
+ {
// If construction can throw, and we have freeSpaceAtBegin(),
// it's easiest to just clear the container and start fresh.
// The alternative would be to keep track of two active, disjoint ranges.