Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-04 09:19:06

0001 // Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 // Qt-Security score:significant reason:default
0004 
0005 #ifndef QCOMPARE_IMPL_H
0006 #define QCOMPARE_IMPL_H
0007 
0008 #if 0
0009 #pragma qt_sync_skip_header_check
0010 #pragma qt_sync_stop_processing
0011 #endif
0012 
0013 #include <QtCore/qtconfigmacros.h>
0014 #include <QtCore/qcompilerdetection.h>
0015 
0016 #include <type_traits>
0017 
0018 QT_BEGIN_NAMESPACE
0019 
0020 namespace QtPrivate {
0021 
0022 // [cmp.categories.pre] / 3, but using a safe bool trick
0023 // and also rejecting std::nullptr_t (unlike the example)
0024 class CompareAgainstLiteralZero {
0025 public:
0026     using SafeZero = void (CompareAgainstLiteralZero::*)();
0027     Q_IMPLICIT constexpr CompareAgainstLiteralZero(SafeZero) noexcept {}
0028 
0029     template <typename T, std::enable_if_t<std::is_null_pointer_v<T>, bool> = true>
0030     CompareAgainstLiteralZero(T) = delete;
0031 };
0032 
0033 } // namespace QtPrivate
0034 
0035 QT_END_NAMESPACE
0036 
0037 #endif // QCOMPARE_IMPL_H