From 8ac881a544e8fc7f85d78132610fce1b696d2025 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Sat, 28 Jan 2023 17:08:05 +0100 Subject: Task/Promise: Don't allow abstract types Supporting abstract types only has little advantages and we might want to store the result by value later. --- src/base/QXmppTask.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/base/QXmppTask.h') diff --git a/src/base/QXmppTask.h b/src/base/QXmppTask.h index 141cf10e..84ba8a33 100644 --- a/src/base/QXmppTask.h +++ b/src/base/QXmppTask.h @@ -50,10 +50,6 @@ private: /// /// Tasks are generated by QXmppPromise and can be handled using QXmppTask::then(). /// -/// It supports abstract types, i.e. you can create a QXmppTask and report MyIq -/// (derived from QXmppStanza) to it and when handling the result it is possible to cast the result -/// back to MyIq. -/// /// Unlike QFuture, this is not thread-safe. This avoids the need to do mutex locking at every /// access though. /// @@ -177,10 +173,7 @@ public: /// /// Moves the result of the operation out of the task. /// - /// Since this returns by value, you will not be able to cast the result to derived types. Use - /// result() for read-only access or register a handler function using then(). - /// - /// \warning This can only be used once the operation is finished. + /// \warning This can only be used once and only after the operation has finished. /// #ifdef QXMPP_DOC [[nodiscard]] T takeResult() -- cgit v1.2.3