Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
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{
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{
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>
62using CompactStorage = typename std::conditional_t<
63 std::conjunction_v<
64 std::is_empty<Object>,
65 std::negation<std::is_final<Object>>
66 >,
69 >;
70
71} // namespace QtPrivate
72
73#undef FOR_EACH_CVREF
74
76
77#endif // QFUNCTIONALTOOLS_IMPL_H
Definition main.cpp:8
Combined button and popup list for selecting options.
\macro QT_NO_KEYWORDS >
typename std::conditional_t< std::conjunction_v< std::is_empty< Object >, std::negation< std::is_final< Object > > >, detail::StorageEmptyBaseClassOptimization< Object, Tag >, detail::StorageByValue< Object, Tag > > CompactStorage
#define FOR_EACH_CVREF(op)
#define MAKE_GETTER(cvref)