Try fixing MSVC 14 bug

I don't know how to test this locally.
This commit is contained in:
Chip Hogg
2022-01-04 14:14:22 -05:00
parent 4246f2db2a
commit 63910131ff

View File

@@ -28,8 +28,19 @@
namespace units::mag
{
// Convenience utility to create an integral base power. For unit tests only.
template<std::intmax_t N, std::intmax_t Num, std::intmax_t Den>
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<prime_base<N>, power>;
};
template<std::intmax_t N, std::intmax_t Num = 1, std::intmax_t Den = 1>
using int_base_power = base_power<prime_base<N>, ratio{Num, Den}>;
using int_base_power = typename IntBasePower<N, Num, Den>::type;
TEST_CASE("Magnitude is invertible")
{