feat: value_cast<Representation, Unit>() complementary conversion function added

This commit is contained in:
Mateusz Pusz
2024-09-13 21:38:59 +02:00
parent ae816a97fc
commit 0670fbdd9f
4 changed files with 28 additions and 8 deletions

View File

@ -1725,6 +1725,7 @@ constexpr quantity_point lvalue_qp{2 * km};
static_assert(value_cast<m>(lvalue_qp).quantity_from_zero().numerical_value_in(m) == 2000);
static_assert(value_cast<float>(lvalue_qp).quantity_from_zero().numerical_value_in(km) == 2.f);
static_assert(value_cast<m, float>(lvalue_qp).quantity_from_zero().numerical_value_in(m) == 2000.f);
static_assert(value_cast<float, m>(lvalue_qp).quantity_from_zero().numerical_value_in(m) == 2000.f);
} // namespace lvalue_tests
static_assert(value_cast<quantity<km, int>>(quantity_point{2000 * m}).quantity_from_zero().numerical_value_in(km) == 2);