Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@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 #ifndef Q20FUNCTIONAL_H
0004 #define Q20FUNCTIONAL_H
0005 
0006 #include <QtCore/qglobal.h>
0007 
0008 #include <functional>
0009 
0010 //
0011 //  W A R N I N G
0012 //  -------------
0013 //
0014 // This file is not part of the Qt API. Types and functions defined in this
0015 // file can reliably be replaced by their std counterparts, once available.
0016 // You may use these definitions in your own code, but be aware that we
0017 // will remove them once Qt depends on the C++ version that supports
0018 // them in namespace std. There will be NO deprecation warning, the
0019 // definitions will JUST go away.
0020 //
0021 // If you can't agree to these terms, don't use these definitions!
0022 //
0023 // We mean it.
0024 //
0025 
0026 #include <functional>
0027 
0028 QT_BEGIN_NAMESPACE
0029 
0030 namespace q20 {
0031 // like std::identity
0032 #ifdef __cpp_lib_ranges
0033 using std::identity;
0034 #else
0035 struct identity
0036 {
0037     struct is_transparent {};
0038     template <typename T>
0039     constexpr T &&operator()(T&& t) const noexcept { return std::forward<T>(t); }
0040 };
0041 #endif // __cpp_lib_ranges
0042 } // namespace q20
0043 
0044 QT_END_NAMESPACE
0045 
0046 #endif /* Q20FUNCTIONAL_H */