From f36205f08d032c523180ebb0e5303842279f10ba Mon Sep 17 00:00:00 2001 From: Chip Hogg Date: Thu, 12 May 2022 18:17:14 +0000 Subject: [PATCH] Capture NTTP in variable This should make it OK for MSVC to take the address, working around a compiler bug. --- src/core/include/units/magnitude.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/include/units/magnitude.h b/src/core/include/units/magnitude.h index 271662f4..cc0028c3 100644 --- a/src/core/include/units/magnitude.h +++ b/src/core/include/units/magnitude.h @@ -420,7 +420,8 @@ constexpr bool operator==(magnitude, magnitude) template constexpr auto pow(magnitude) { - if constexpr (E.num == 0) { + constexpr auto exp = E; + if constexpr (exp.num == 0) { return magnitude<>{}; } else { return magnitude{};