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
qcompare_impl.h
Go to the documentation of this file.
1
// Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
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
#
ifndef
QCOMPARE_IMPL_H
6
#
define
QCOMPARE_IMPL_H
7
8
#
if
0
9
#
pragma
qt_sync_skip_header_check
10
#
pragma
qt_sync_stop_processing
11
#
endif
12
13
#
include
<
QtCore
/
qtconfigmacros
.
h
>
14
#
include
<
QtCore
/
qcompilerdetection
.
h
>
15
16
#
include
<
type_traits
>
17
18
QT_BEGIN_NAMESPACE
19
20
namespace
QtPrivate
{
21
22
// [cmp.categories.pre] / 3, but using a safe bool trick
23
// and also rejecting std::nullptr_t (unlike the example)
24
class
CompareAgainstLiteralZero
{
25
public
:
26
using
SafeZero
=
void
(
CompareAgainstLiteralZero
::*)();
27
Q_IMPLICIT
constexpr
CompareAgainstLiteralZero
(
SafeZero
)
noexcept
{}
28
29
template
<
typename
T, std::enable_if_t<std::is_null_pointer_v<T>,
bool
> =
true
>
30
CompareAgainstLiteralZero
(T) =
delete
;
31
};
32
33
}
// namespace QtPrivate
34
35
QT_END_NAMESPACE
36
37
#
endif
// QCOMPARE_IMPL_H
QtPrivate::CompareAgainstLiteralZero
Definition
qcompare_impl.h:24
QtPrivate::CompareAgainstLiteralZero::SafeZero
void(CompareAgainstLiteralZero::*)() SafeZero
Definition
qcompare_impl.h:26
QtPrivate::CompareAgainstLiteralZero::CompareAgainstLiteralZero
CompareAgainstLiteralZero(T)=delete
QtPrivate
Definition
qalloc.h:29
qtbase
src
corelib
global
qcompare_impl.h
Generated on
for Qt by
1.16.1