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 29b65c98e7.

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>
bb10
Marc Mutz 2023-12-15 11:18:05 +01:00
parent b404930e12
commit 0d0cd1fe2c
1 changed files with 5 additions and 3 deletions

View File

@ -141,9 +141,11 @@ public:
protected:
template <
class T,
std::enable_if_t<std::conjunction_v<
std::negation<std::is_same<q20::remove_cvref_t<T>, function_ref_base>>,
std::negation<std::is_pointer<T>>
std::enable_if_t<std::negation_v<
std::disjunction<
std::is_same<T, function_ref_base>,
std::is_pointer<T>
>
>, bool> = true
>
function_ref_base& operator=(T) = delete;