From f004854a9ef7c5b141954f5d61db4aa2162eb053 Mon Sep 17 00:00:00 2001 From: Chip Hogg Date: Wed, 15 Jun 2022 21:44:27 +0000 Subject: [PATCH] Remove useful names to appease MSVC 14 Looks like another compiler bug, where it considers a formal parameter to be "unused" if it isn't used in any `if constexpr` branch. --- src/core/include/units/magnitude.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/include/units/magnitude.h b/src/core/include/units/magnitude.h index 61b67611..ddf18cce 100644 --- a/src/core/include/units/magnitude.h +++ b/src/core/include/units/magnitude.h @@ -577,16 +577,16 @@ constexpr auto common_magnitude(Magnitude auto m, magnitude<>) { return detail:: // Recursive case for the common Magnitude of any two non-identity Magnitudes. template -constexpr auto common_magnitude(magnitude m1, magnitude m2) +constexpr auto common_magnitude(magnitude, magnitude) { using detail::remove_positive_power; if constexpr (H1.get_base() < H2.get_base()) { // When H1 has the smaller base, prepend to result from recursion. - return remove_positive_power(magnitude

{}) * common_magnitude(magnitude{}, m2); + return remove_positive_power(magnitude

{}) * common_magnitude(magnitude{}, magnitude{}); } else if constexpr (H2.get_base() < H1.get_base()) { // When H2 has the smaller base, prepend to result from recursion. - return remove_positive_power(magnitude

{}) * common_magnitude(m1, magnitude{}); + return remove_positive_power(magnitude

{}) * common_magnitude(magnitude{}, magnitude{}); } else { // When the bases are equal, pick whichever has the lower power. constexpr auto common_tail = common_magnitude(magnitude{}, magnitude{});