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
qfunctionaltools_impl.h
Go to the documentation of this file.
1// Copyright (C) 2023 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#if 0
5#pragma qt_sync_skip_header_check
6#pragma qt_sync_stop_processing
7#endif
8
9#ifndef QFUNCTIONALTOOLS_IMPL_H
10#define QFUNCTIONALTOOLS_IMPL_H
11
12#include <QtCore/qtconfigmacros.h>
13
14#include <type_traits>
15#include <utility>
16
17QT_BEGIN_NAMESPACE
18
19namespace QtPrivate {
20
21namespace detail {
22
23#define FOR_EACH_CVREF(op)
24 op(&)
25 op(const &)
26 op(&&)
27 op(const &&)
28 /* end */
29
30
31template <typename Object, typename = void>
33{
34 Object o;
35#define MAKE_GETTER(cvref)
36 constexpr Object cvref object() cvref noexcept
37 { return static_cast<Object cvref>(o); }
39#undef MAKE_GETTER
40};
41
42template <typename Object, typename Tag = void>
44{
47 : Object(std::move(o))
48 {}
50 : Object(o)
51 {}
52
53#define MAKE_GETTER(cvref)
54 constexpr Object cvref object() cvref noexcept
55 { return static_cast<Object cvref>(*this); }
57#undef MAKE_GETTER
58};
59} // namespace detail
60
61template <typename Object, typename Tag = void>
66 >,
69 >;
70
71} // namespace QtPrivate
72
73#undef FOR_EACH_CVREF
74
75QT_END_NAMESPACE
76
77#endif // QFUNCTIONALTOOLS_IMPL_H
\macro QT_NO_KEYWORDS >
Definition qcompare.h:24
#define FOR_EACH_CVREF(op)