Made quantity_cast more versatile

- One can now change the unit type without changing the representation type.
- One can now change the representation type without changing the unit type.
- Had to implement std::common_type<my_value, my_value> to still compile
  integration tests. (It implicitly converted to another representation
  before.)
This commit is contained in:
Jan Sende
2019-09-30 01:45:38 +02:00
committed by Jan Sende
parent 952b19c2ed
commit dc85dd84b9
2 changed files with 15 additions and 1 deletions
+4
View File
@@ -62,6 +62,10 @@ namespace units {
namespace std {
template<typename T, typename U>
struct common_type<my_value<T>, my_value<U>> : common_type<T, U> {
};
template<typename T, typename U>
struct common_type<my_value<T>, U> : common_type<T, U> {
};