Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtconcurrenttask.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QTCONCURRENTTASK_H
6#define QTCONCURRENTTASK_H
7
8#if 0
9#pragma qt_class(QtConcurrentTask)
10#endif
11
12#if !defined(QT_NO_CONCURRENT)
13
14#include <QtConcurrent/qtaskbuilder.h>
15
16QT_BEGIN_NAMESPACE
17
18#ifdef Q_QDOC
19
20namespace QtConcurrent {
21
22template <class Task>
23[[nodiscard]]
24QTaskBuilder<Task> task(Task &&task);
25
26} // namespace QtConcurrent
27
28#else
29
30namespace QtConcurrent {
31
32template <class Task>
33[[nodiscard]]
34constexpr auto task(Task &&t) { return QTaskBuilder(std::forward<Task>(t)); }
35
36} // namespace QtConcurrent
37
38#endif // Q_QDOC
39
40QT_END_NAMESPACE
41
42#endif // !defined(QT_NO_CONCURRENT)
43
44#endif // QTCONCURRENTTASK_H
\inmodule QtConcurrent
constexpr auto task(Task &&t)