mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-07 17:50:59 +08:00
qt 6.5.1 original
This commit is contained in:
33
src/corelib/global/qcompare_impl.h
Normal file
33
src/corelib/global/qcompare_impl.h
Normal file
@ -0,0 +1,33 @@
|
||||
// Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
#if 0
|
||||
#pragma qt_sync_skip_header_check
|
||||
#pragma qt_sync_stop_processing
|
||||
#endif
|
||||
|
||||
#ifndef QCOMPARE_IMPL_H
|
||||
#define QCOMPARE_IMPL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
namespace QtPrivate {
|
||||
|
||||
// [cmp.categories.pre] / 3, but using a safe bool trick
|
||||
// and also rejecting std::nullptr_t (unlike the example)
|
||||
class CompareAgainstLiteralZero {
|
||||
public:
|
||||
using SafeZero = void (CompareAgainstLiteralZero::*)();
|
||||
Q_IMPLICIT constexpr CompareAgainstLiteralZero(SafeZero) noexcept {}
|
||||
|
||||
template <typename T, std::enable_if_t<!std::is_same_v<T, int>, bool> = false>
|
||||
CompareAgainstLiteralZero(T) = delete;
|
||||
};
|
||||
|
||||
} // namespace QtPrivate
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QCOMPARE_IMPL_H
|
Reference in New Issue
Block a user