mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 20:34:26 +02:00
[msvc][fix] some more errros in examples
This commit is contained in:
@@ -59,19 +59,19 @@ void si_example()
|
||||
const quantity c2 = pow<2>(c);
|
||||
|
||||
const quantity p1 = isq::momentum(4. * GeV / c);
|
||||
const QuantityOf<isq::mass> 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"
|
||||
|
@@ -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<earth_gravity_model M>
|
||||
|
Reference in New Issue
Block a user