diff options
Diffstat (limited to 'src/base/QXmppTask.h')
| -rw-r--r-- | src/base/QXmppTask.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/base/QXmppTask.h b/src/base/QXmppTask.h index c11557ac..141cf10e 100644 --- a/src/base/QXmppTask.h +++ b/src/base/QXmppTask.h @@ -104,10 +104,11 @@ public: #endif void then(QObject *context, Continuation continuation) { - static_assert( - std::is_void_v<T> && std::is_invocable_v<Continuation> || - !std::is_void_v<T> /* && invocable with T && causes forming ref to void error */, - "Function needs to be invocable with T && or without params for T=void."); + if constexpr (!std::is_void_v<T>) { + static_assert(std::is_invocable_v<Continuation, T &&>, "Function needs to be invocable with T &&."); + } else { + static_assert(std::is_invocable_v<Continuation>, "Function needs to be invocable without arguments."); + } using namespace QXmpp::Private; if (d.isFinished()) { |
