From 4313df390c853a95eb34d809402bc0a7f444d3b8 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Wed, 3 Aug 2022 13:34:45 +0200 Subject: [PATCH] refactor: `hypot` refactored to use variadic `common_type` version --- src/core/include/units/math.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/include/units/math.h b/src/core/include/units/math.h index 2e9e7027..6afb3b44 100644 --- a/src/core/include/units/math.h +++ b/src/core/include/units/math.h @@ -327,10 +327,9 @@ template * without undue overflow or underflow at intermediate stages of the computation */ template -[[nodiscard]] inline std::common_type_t, Q3> hypot(const Q1& x, const Q2& y, - const Q3& z) noexcept - requires requires { typename std::common_type_t, Q3>; } && - requires(std::common_type_t, Q3> q) { +[[nodiscard]] inline std::common_type_t hypot(const Q1& x, const Q2& y, const Q3& z) noexcept + requires requires { typename std::common_type_t; } && + requires(std::common_type_t q) { pow<2>(x); pow<2>(y); pow<2>(z); @@ -339,7 +338,7 @@ template requires { std::hypot(q.number(), q.number(), q.number()); }; } { - using type = std::common_type_t, Q3>; + using type = std::common_type_t; type xx = x; type yy = y; type zz = z;