Capture NTTP in variable

This should make it OK for MSVC to take the address, working around a
compiler bug.
This commit is contained in:
Chip Hogg
2022-05-12 18:17:14 +00:00
parent 88a69cecd8
commit f36205f08d

View File

@@ -420,7 +420,8 @@ constexpr bool operator==(magnitude<LeftBPs...>, magnitude<RightBPs...>)
template<ratio E, auto... BPs> template<ratio E, auto... BPs>
constexpr auto pow(magnitude<BPs...>) constexpr auto pow(magnitude<BPs...>)
{ {
if constexpr (E.num == 0) { constexpr auto exp = E;
if constexpr (exp.num == 0) {
return magnitude<>{}; return magnitude<>{};
} else { } else {
return magnitude<pow(BPs, E)...>{}; return magnitude<pow(BPs, E)...>{};