Ensure `value_cast<QP>` uses the minimum number of operataions needed
This PR is supposed to continue from the discussion here, where value_cast<QP> was introduced.
Basically, value_cast<QP> does three steps:
- Convert the representation/unit of the input quantity_point to an intermediate representation, not touching the origin
- Change the origin by adding a suitable offset
- Convert the representation/unit of the intermediate quantity_point to the final representation.
However, in the current implementation, the second step (change of origin) may in fact introduce more representation conversions internally: to a common representation between the offset and the value. However, here, that is not necessary, because the representation of the value is already chosen suitably.
@burnpanck, I fixed all the CI issues today. If you could rebase to master, we would see this change's real CI status.
@burnpanck, do you still plan to work on your PRs?
Hi @burnpanck! Do you plan to work on those in the near future. I plan to release mp-units 2.3 soon.