Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-14 09:18:30

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