From 9505bd84db40d645cd56d791fe1af614d287b5d7 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 2 Feb 2021 11:39:05 +0100 Subject: [PATCH] De-const the members of QHypotHelper to enable assignment operators Being able to iterate h = h.add(next) over a sequence of numbers makes it possible to implement arbitrarily-many parameter functions that need hypot, e.g. the implementation of V4's Math.hypot(). This amends commit b08368d99fa41b3f84cf30468c2dc9f5c2c43423. Change-Id: I76bb65bd5f318e915d42fa4c935129850e258132 Reviewed-by: Andrei Golubev Reviewed-by: Ulf Hermann --- src/corelib/kernel/qmath.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qmath.h b/src/corelib/kernel/qmath.h index 298bb630fb..18530714e0 100644 --- a/src/corelib/kernel/qmath.h +++ b/src/corelib/kernel/qmath.h @@ -143,7 +143,7 @@ struct QHypotType { using type = decltype(std::hypot(R(1), F(1))); }; template class QHypotHelper { - const T scale, total; + T scale, total; template friend class QHypotHelper; QHypotHelper(T first, T prior) : scale(first), total(prior) {} public: