Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:07:20

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 QT_BEGIN_NAMESPACE
0016 
0017 namespace QtPrivate {
0018 
0019 // [cmp.categories.pre] / 3, but using a safe bool trick
0020 // and also rejecting std::nullptr_t (unlike the example)
0021 class CompareAgainstLiteralZero {
0022 public:
0023     using SafeZero = void (CompareAgainstLiteralZero::*)();
0024     Q_IMPLICIT constexpr CompareAgainstLiteralZero(SafeZero) noexcept {}
0025 
0026     template <typename T, std::enable_if_t<std::is_null_pointer_v<T>, bool> = true>
0027     CompareAgainstLiteralZero(T) = delete;
0028 };
0029 
0030 } // namespace QtPrivate
0031 
0032 QT_END_NAMESPACE
0033 
0034 #endif // QCOMPARE_IMPL_H