aboutsummaryrefslogtreecommitdiff
path: root/src/base/QXmppFutureUtils_p.h
diff options
context:
space:
mode:
authorMelvin Keskin <melvo@olomono.de>2022-01-08 08:26:46 +0000
committerLinus Jahn <lnj@kaidan.im>2022-01-15 14:04:15 +0100
commitfd11e024a6079be3e0bc62911b6e3070c7553224 (patch)
tree199a3d658bc1641259faffd588534788fadb05dd /src/base/QXmppFutureUtils_p.h
parentee1ea9091f128164f91d29d7a3598d792326c1a7 (diff)
downloadqxmpp-fd11e024a6079be3e0bc62911b6e3070c7553224.tar.gz
Run 'clang-format' on all files
Diffstat (limited to 'src/base/QXmppFutureUtils_p.h')
-rw-r--r--src/base/QXmppFutureUtils_p.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/base/QXmppFutureUtils_p.h b/src/base/QXmppFutureUtils_p.h
index 6becf879..61a9075b 100644
--- a/src/base/QXmppFutureUtils_p.h
+++ b/src/base/QXmppFutureUtils_p.h
@@ -28,7 +28,8 @@ namespace QXmpp::Private {
// helper for std::visit
template<class... Ts>
-struct overloaded : Ts... {
+struct overloaded : Ts...
+{
using Ts::operator()...;
};
// explicit deduction guide (not needed as of C++20)
@@ -42,7 +43,8 @@ template<typename F, typename Ret, typename A, typename... Rest>
A lambda_helper(Ret (F::*)(A, Rest...) const);
template<typename F>
-struct first_argument {
+struct first_argument
+{
using type = decltype(lambda_helper(&F::operator()));
};
@@ -70,10 +72,10 @@ void awaitLast(const QFuture<T> &future, QObject *context, Handler handler)
auto *watcher = new QFutureWatcher<T>(context);
QObject::connect(watcher, &QFutureWatcherBase::finished,
context, [watcher, handler { std::move(handler) }]() {
- auto future = watcher->future();
- handler(future.resultAt(future.resultCount() - 1));
- watcher->deleteLater();
- });
+ auto future = watcher->future();
+ handler(future.resultAt(future.resultCount() - 1));
+ watcher->deleteLater();
+ });
watcher->setFuture(future);
}
@@ -83,9 +85,9 @@ void await(const QFuture<T> &future, QObject *context, Handler handler)
auto *watcher = new QFutureWatcher<T>(context);
QObject::connect(watcher, &QFutureWatcherBase::finished,
context, [watcher, handler { std::move(handler) }]() {
- handler(watcher->result());
- watcher->deleteLater();
- });
+ handler(watcher->result());
+ watcher->deleteLater();
+ });
watcher->setFuture(future);
}
@@ -95,9 +97,9 @@ void await(const QFuture<void> &future, QObject *context, Handler handler)
auto *watcher = new QFutureWatcher<void>(context);
QObject::connect(watcher, &QFutureWatcherBase::finished,
context, [watcher, handler { std::move(handler) }]() {
- handler();
- watcher->deleteLater();
- });
+ handler();
+ watcher->deleteLater();
+ });
watcher->setFuture(future);
}