summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qxpfunctional.h
Commit message (Collapse)AuthorAgeFilesLines
* qxp::function_ref: reuse a constraint for the deduction guideMarc Mutz2023-12-161-1/+1
| | | | | | | | | | | | No functional change, just using the already-existing named constraint instead of more enable_if fiddling. Amends 29b65c98e720056e87334ce88a683969e57efd3d. Pick-to: 6.7 6.6 6.5 Change-Id: Idae4962834f14e2a5273099b5611ebcbb2a54447 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qxp::function_ref: simplify the constraint on op=(T) = deleteMarc Mutz2023-12-161-3/+5
| | | | | | | | | | | | | | Drop the remove_cvref_t (T is already decayed by way of take-by-value) and apply De Morgan's Law. No functional change, just fewer templates to instantiate. Amends 29b65c98e720056e87334ce88a683969e57efd3d. Pick-to: 6.7 6.6 6.5 Change-Id: I0c0f8c4a288145d05636fb053cc260a917fcc4c5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qxp::function_ref: try to work around compilation failure on VxWorksMarc Mutz2023-11-231-0/+17
| | | | | | | | | Task-number: QTBUG-115777 Pick-to: 6.6 6.5 Change-Id: Icda59c33ae8c92460c7cb06e204c6b1926b82f66 Reviewed-by: Krzysztof Sommerfeld <krzysztof.sommerfeld@siili.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Move q20::remove_cvref to q20type_traits.hMarc Mutz2023-01-121-1/+1
| | | | | | | | The original is defined in <type_traits>, not <functional>. Pick-to: 6.5 Change-Id: I596e56f64d2eed609ad2f7e6f03ae006afaa2fa9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qNN headers: only promise what we can keepMarc Mutz2022-11-191-3/+3
| | | | | | | | | | | | | | | | In general, we can't make the qNN types behave exactly like their C++NN std counter-parts, because their exact semantics and implementation may depend on C++NN language features, while qNN are back-ports to C++ standards older than NN. Adjust the warning message accordingly. Thanks to Eddy for noticing. Pick-to: 6.4 Change-Id: I8533214549f2140a99e2216e3bcd979263fe100c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Revert "qxp::function_ref: drop use of q23::invoke_r"Marc Mutz2022-06-141-3/+5
| | | | | | | | | | | | | | | | | | | | This reverts commit b9cce12e76796962e5e5ad0d5408370af56af459, which broke function_ref<void(int)> f = [](int i) { return i; }; ie. swallowing of return types. We could maybe implement the same without invoke_r, with the same manual if-constexpr that invoke_r has, but it would be a pointless duplication across the two thunks we have, so just use invoke_r. Add tests. Pick-to: 6.4 Task-number: QTBUG-103739 Change-Id: I6034f05d813c06a25e8058ded5b6b62f3ca858b4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qxp::function_ref: drop use of q23::invoke_rMarc Mutz2022-06-021-5/+3
| | | | | | | | | | | | Since P0792r8, pointers to members are no longer supported, which means we don't need to use std::invoke anymore. Remove std::invoke in favor of traditional function call syntax, which should be faster to compile, too. Change-Id: I2ec3888795471f345ded36bb564d35ac0de29068 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Short live qxp::function_ref!Marc Mutz2022-06-021-0/+176
This is an implementation of function_ref, which has been proposed for inclusion into C++23, but has not been accepted, yet, which is why we place it in namespace qxp (for eXPerimental) instead of q23. The implementation is based on wg21.link/P0792r9, which, at the time of writing, is the latest revision of the paper. It will be used in both QTestLib and qmldom. Fixes: QTBUG-103739 Change-Id: I52723eca28f7ac02ce7ce51928361d81ae5c92b1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>