Warning, file /include/QtCore/q23functional.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003 #ifndef Q23FUNCTIONAL_H
0004 #define Q23FUNCTIONAL_H
0005
0006 #include <QtCore/qglobal.h>
0007 #include <QtCore/q20functional.h>
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 QT_BEGIN_NAMESPACE
0026
0027 namespace q23 {
0028
0029 #ifdef __cpp_lib_invoke_r
0030 using std::invoke_r;
0031 #else
0032 template <typename R, typename F, typename...Args>
0033 constexpr
0034 std::enable_if_t<std::is_invocable_r_v<R, F, Args...>, R>
0035 invoke_r(F&& f, Args&&... args)
0036 noexcept(std::is_nothrow_invocable_r_v<R, F, Args...>)
0037 {
0038
0039 if constexpr (std::is_void_v<R>)
0040 std::invoke(std::forward<F>(f), std::forward<Args>(args)...);
0041 else
0042 return std::invoke(std::forward<F>(f), std::forward<Args>(args)...);
0043 }
0044 #endif
0045 }
0046
0047 QT_END_NAMESPACE
0048
0049 #endif