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
q23type_traits.h
Go to the documentation of this file.
1// Copyright (C) 2024 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#ifndef Q23TYPE_TRAITS_H
5#define Q23TYPE_TRAITS_H
6
7#include <QtCore/q20type_traits.h>
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. Types and functions defined in this
14// file can reliably be replaced by their std counterparts, once available.
15// You may use these definitions in your own code, but be aware that we
16// will remove them once Qt depends on the C++ version that supports
17// them in namespace std. There will be NO deprecation warning, the
18// definitions will JUST go away.
19//
20// If you can't agree to these terms, don't use these definitions!
21//
22// We mean it.
23//
24
25QT_BEGIN_NAMESPACE
26
27namespace q23 {
28// like std::is_scoped_enum
29#ifdef __cpp_lib_is_scoped_enum
30using std::is_scoped_enum;
32#else
33
34template <typename E, bool isEnum = std::is_enum_v<E>>
37
38template<typename T>
39struct is_scoped_enum<T, false> : std::false_type
40{};
41
42template <typename E>
43inline constexpr bool is_scoped_enum_v = is_scoped_enum<E>::value;
44#endif // __cpp_lib_is_scoped_enum
45}
46
47QT_END_NAMESPACE
48
49#endif /* Q23TYPE_TRAITS_H */
constexpr bool is_scoped_enum_v