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
4#ifndef QTCONCURRENTTASK_H
5#define QTCONCURRENTTASK_H
6
7#if !defined(QT_NO_CONCURRENT)
8
9#include <QtConcurrent/qtaskbuilder.h>
10
11QT_BEGIN_NAMESPACE
12
13#ifdef Q_QDOC
14
15namespace QtConcurrent {
16
17template <class Task>
18[[nodiscard]]
19QTaskBuilder<Task> task(Task &&task);
20
21} // namespace QtConcurrent
22
23#else
24
25namespace QtConcurrent {
26
27template <class Task>
28[[nodiscard]]
29constexpr auto task(Task &&t) { return QTaskBuilder(std::forward<Task>(t)); }
30
31} // namespace QtConcurrent
32
33#endif // Q_QDOC
34
35QT_END_NAMESPACE
36
37#endif // !defined(QT_NO_CONCURRENT)
38
39#endif // QTCONCURRENTTASK_H
40

source code of qtbase/src/concurrent/qtconcurrenttask.h