From 0d0cd1fe2c4f2d90a8184ce88383bdf1ff35b338 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.7 6.6 6.5 Change-Id: I0c0f8c4a288145d05636fb053cc260a917fcc4c5 Reviewed-by: Fabian Kosmale Reviewed-by: Thiago Macieira --- 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 60508f6315..24e74daaea 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;