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
0004 #ifndef Q23FUNCTIONAL_H
0005 #define Q23FUNCTIONAL_H
0006
0007 #include <QtCore/qglobal.h>
0008 #include <QtCore/q20functional.h>
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 QT_BEGIN_NAMESPACE
0027
0028 namespace q23 {
0029
0030 #ifdef __cpp_lib_invoke_r
0031 using std::invoke_r;
0032 #else
0033 template <typename R, typename F, typename...Args>
0034 constexpr
0035 std::enable_if_t<std::is_invocable_r_v<R, F, Args...>, R>
0036 invoke_r(F&& f, Args&&... args)
0037 noexcept(std::is_nothrow_invocable_r_v<R, F, Args...>)
0038 {
0039
0040 if constexpr (std::is_void_v<R>)
0041 std::invoke(std::forward<F>(f), std::forward<Args>(args)...);
0042 else
0043 return std::invoke(std::forward<F>(f), std::forward<Args>(args)...);
0044 }
0045 #endif
0046 }
0047
0048 QT_END_NAMESPACE
0049
0050 #endif