From d2f7177d421747225c68ba26e4f92d91909bf9b9 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 15 Dec 2023 11:18:05 +0100 Subject: [PATCH] qxp::function_ref: simplify the constraint on op=(T) = delete 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.5 Change-Id: I0c0f8c4a288145d05636fb053cc260a917fcc4c5 Reviewed-by: Fabian Kosmale Reviewed-by: Thiago Macieira (cherry picked from commit 0d0cd1fe2c4f2d90a8184ce88383bdf1ff35b338) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 0f675e0f62d03aeb3d6718147954b0368d955c71) --- src/corelib/global/qxpfunctional.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/corelib/global/qxpfunctional.h b/src/corelib/global/qxpfunctional.h index cc2942b1c6a..cbeef8b2932 100644 --- a/src/corelib/global/qxpfunctional.h +++ b/src/corelib/global/qxpfunctional.h @@ -141,9 +141,11 @@ public: protected: template < class T, - std::enable_if_t, function_ref_base>>, - std::negation> + std::enable_if_t, + std::is_pointer + > >, bool> = true > function_ref_base& operator=(T) = delete;