refactor: all examples refactored to use a simplified quantity creation

This commit is contained in:
Mateusz Pusz
2023-02-08 21:47:48 -08:00
parent 26ed241662
commit 859bc20fdc
18 changed files with 150 additions and 162 deletions

View File

@@ -39,10 +39,10 @@ int main()
using namespace mp_units::si::unit_symbols;
using namespace mp_units::international::unit_symbols;
constexpr auto v1 = isq::speed(110, km / h);
constexpr auto v2 = isq::speed(70., mph);
constexpr auto v3 = avg_speed(isq::distance(220, km), isq::duration(2, h));
constexpr auto v4 = avg_speed(quantity<isq::distance[mi]>{140}, quantity<isq::duration[h]>{2});
constexpr auto v1 = 110 * (km / h);
constexpr auto v2 = 70. * mph;
constexpr auto v3 = avg_speed(220 * km, 2 * h);
constexpr auto v4 = avg_speed(140 * mi, 2 * h);
constexpr auto v5 = value_cast<m / s>(v3);
constexpr auto v6 = value_cast<m / s>(v4);
constexpr auto v7 = value_cast<int>(v6);