Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:26:23

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 
0004 #ifndef QCOMPARE_IMPL_H
0005 #define QCOMPARE_IMPL_H
0006 
0007 #if 0
0008 #pragma qt_sync_skip_header_check
0009 #pragma qt_sync_stop_processing
0010 #endif
0011 
0012 #include <QtCore/qtconfigmacros.h>
0013 #include <QtCore/qcompilerdetection.h>
0014 
0015 #include <type_traits>
0016 
0017 QT_BEGIN_NAMESPACE
0018 
0019 namespace QtPrivate {
0020 
0021 // [cmp.categories.pre] / 3, but using a safe bool trick
0022 // and also rejecting std::nullptr_t (unlike the example)
0023 class CompareAgainstLiteralZero {
0024 public:
0025     using SafeZero = void (CompareAgainstLiteralZero::*)();
0026     Q_IMPLICIT constexpr CompareAgainstLiteralZero(SafeZero) noexcept {}
0027 
0028     template <typename T, std::enable_if_t<std::is_null_pointer_v<T>, bool> = true>
0029     CompareAgainstLiteralZero(T) = delete;
0030 };
0031 
0032 } // namespace QtPrivate
0033 
0034 QT_END_NAMESPACE
0035 
0036 #endif // QCOMPARE_IMPL_H