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
24
QT_BEGIN_NAMESPACE
25
26
namespace
q23
{
27
// like std::is_scoped_enum
28
#
ifdef
__cpp_lib_is_scoped_enum
29
using
std
::
is_scoped_enum
;
30
using
std
::
is_scoped_enum_v
;
31
#
else
32
33
template
<
typename
E
,
bool
isEnum
=
std
::
is_enum_v
<
E
>>
34
struct
is_scoped_enum
:
std
::
negation
<
std
::
is_convertible
<
E
,
std
::
underlying_type_t
<
E
>>>
35
{};
36
37
template
<
typename
T>
38
struct
is_scoped_enum
<
T
,
false
> :
std
::
false_type
39
{};
40
41
template
<
typename
E
>
42
inline
constexpr
bool
is_scoped_enum_v
=
is_scoped_enum
<
E
>::
value
;
43
#
endif
// __cpp_lib_is_scoped_enum
44
}
45
46
QT_END_NAMESPACE
47
48
#
endif
/* Q23TYPE_TRAITS_H */
q23
Definition
q23functional.h:27
q23::is_scoped_enum_v
constexpr bool is_scoped_enum_v
Definition
q23type_traits.h:42
q23::is_scoped_enum< T, false >
Definition
q23type_traits.h:39
qtbase
src
corelib
global
q23type_traits.h
Generated on
for Qt by
1.14.0