summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qpromise.h
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-05-19 12:05:23 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-06-08 22:41:58 +0200
commit49c5724cb8eeebf8176b2122401716f8d11bcc11 (patch)
tree2dfbe9135abbec4c74ad00224250bd80aca538ba /src/corelib/thread/qpromise.h
parent524b957d1f7d616ce511f424f78b8d5e37091787 (diff)
QPromise/QFutureInterface: in Qt 7 take std::exception_ptr by const-ref
std::exception_ptr is a reference-counted "smart pointer", so we shouldn't copy it around freely. Unfortunately QFutureInterface has exported functions taking it by value, so we can't just change the signatures and keep BC. Simply prepare the code for Qt 7. Change-Id: Ic5aae6a095c8c842872a40db440c99d2dfe371f1 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/corelib/thread/qpromise.h')
-rw-r--r--src/corelib/thread/qpromise.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/thread/qpromise.h b/src/corelib/thread/qpromise.h
index afe51e07d0c..a1ac8eaf279 100644
--- a/src/corelib/thread/qpromise.h
+++ b/src/corelib/thread/qpromise.h
@@ -85,7 +85,11 @@ public:
}
#ifndef QT_NO_EXCEPTIONS
void setException(const QException &e) { d.reportException(e); }
+#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
void setException(std::exception_ptr e) { d.reportException(e); }
+#else
+ void setException(const std::exception_ptr &e) { d.reportException(e); }
+#endif
#endif
void start() { d.reportStarted(); }
void finish() { d.reportFinished(); }