mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-01 03:14:29 +02:00
refactor: all examples refactored to use a simplified quantity creation
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user