diff --git a/test/unit_test/runtime/magnitude_test.cpp b/test/unit_test/runtime/magnitude_test.cpp index 5a866db2..afbaf62f 100644 --- a/test/unit_test/runtime/magnitude_test.cpp +++ b/test/unit_test/runtime/magnitude_test.cpp @@ -28,8 +28,19 @@ namespace units::mag { +// Convenience utility to create an integral base power. For unit tests only. +template +struct IntBasePower +{ + // This setup is more complicated than might appear necessary in the hopes of appeasing a + // (possibly spurious) MSVC 14 compiler error. + static constexpr std::intmax_t num = Num; + static constexpr std::intmax_t den = Den; + static constexpr ratio power = ratio{num, den}; + using type = base_power, power>; +}; template -using int_base_power = base_power, ratio{Num, Den}>; +using int_base_power = typename IntBasePower::type; TEST_CASE("Magnitude is invertible") {