From 482150eca1f868bf846c45c4bb804166d9e63efb Mon Sep 17 00:00:00 2001 From: Jonas Hoppe <162709928+czjhoppe@users.noreply.github.com> Date: Fri, 30 Aug 2024 13:20:16 +0200 Subject: [PATCH] [msvc][fix] some more errros in examples --- example/total_energy.cpp | 14 +++++++------- example/unmanned_aerial_vehicle.cpp | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/example/total_energy.cpp b/example/total_energy.cpp index 95d23f31..f0b961b9 100644 --- a/example/total_energy.cpp +++ b/example/total_energy.cpp @@ -59,19 +59,19 @@ void si_example() const quantity c2 = pow<2>(c); const quantity p1 = isq::momentum(4. * GeV / c); - const QuantityOf auto m1 = 3. * GeV / c2; - const quantity E = total_energy(p1, m1, c); + const QuantityOf<(isq::mass)> auto m1 = 3. * GeV / c2; + const quantity E1 = total_energy(p1, m1, c); std::cout << "\n*** SI units (c = " << c << " = " << c.in(si::metre / s) << ") ***\n"; std::cout << "\n[in `GeV` and `c`]\n" << "p = " << p1 << "\n" << "m = " << m1 << "\n" - << "E = " << E << "\n"; + << "E = " << E1 << "\n"; const quantity p2 = p1.in(GeV / (m / s)); - const quantity m2 = m1.in(GeV / pow<2>(m / s)); - const quantity E2 = total_energy(p2, m2, c).in(GeV); + const quantity metre2 = m1.in(GeV / pow<2>(m / s)); + const quantity E2 = total_energy(p2, metre2, c).in(GeV); std::cout << "\n[in `GeV`]\n" << "p = " << p2 << "\n" @@ -79,8 +79,8 @@ void si_example() << "E = " << E2 << "\n"; const quantity p3 = p1.in(kg * m / s); - const quantity m3 = m1.in(kg); - const quantity E3 = total_energy(p3, m3, c).in(J); + const quantity metre3 = m1.in(kg); + const quantity E3 = total_energy(p3, metre3, c).in(J); std::cout << "\n[in SI base units]\n" << "p = " << p3 << "\n" diff --git a/example/unmanned_aerial_vehicle.cpp b/example/unmanned_aerial_vehicle.cpp index 3e26ac08..8a8648d5 100644 --- a/example/unmanned_aerial_vehicle.cpp +++ b/example/unmanned_aerial_vehicle.cpp @@ -70,6 +70,7 @@ constexpr const char* to_text(earth_gravity_model m) return "EGM2008-1"; } assert(false && "unsupported enum value"); + return "unsupported enum value"; } template