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.cpp
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// Qt-Security score:significant reason:default
4
5#include <QtCore/qfunctionaltools_impl.h>
6
7// Remove this file once we have tests that implicitly test all aspects of
8// CompactStorage
9
10QT_BEGIN_NAMESPACE
11
12namespace QtPrivate {
13
14#define FOR_EACH_CVREF(op)
15 op(&)
16 op(const &)
17 op(&&)
18 op(const &&)
19 /* end */
20
21namespace _testing {
22 struct empty {};
23 struct final final {};
24 static_assert(std::is_same_v<CompactStorage<empty>,
26 static_assert(std::is_same_v<CompactStorage<final>,
28 static_assert(std::is_same_v<CompactStorage<int>,
29 detail::StorageByValue<int>>);
30#define CHECK1(Obj, cvref)
31 static_assert(std::is_same_v<decltype(std::declval<CompactStorage< Obj > cvref>().object()),
32 Obj cvref>);
33#define CHECK(cvref)
34 CHECK1(empty, cvref)
35 CHECK1(final, cvref)
36 CHECK1(int, cvref)
37 /* end */
38
40#undef CHECK
41#undef CHECK1
42} // namespace _testing
43
44} // namespace QtPrivate
45
46#undef FOR_EACH_CVREF
47
48QT_END_NAMESPACE
#define FOR_EACH_CVREF(op)