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