mpusz / mp-units

The quantities and units library for C++
https://mpusz.github.io/mp-units/
MIT License
1.06k stars 85 forks source link

Should `quantity_point_like_traits` work on raw values? #531

Closed mpusz closed 2 months ago

mpusz commented 9 months ago

quantity_point_traits require to_numerical_value and from_numerical_value member functions.

quantity_point_like_traits require to_quantity and from_quantity. This is consistent with the quantity_point and std::chrono::time_point design but is inconsistent with quantity_point_traits and may make it harder for the user-defined types (see the example in https://mpusz.github.io/mp-units/2.2/users_guide/use_cases/interoperability_with_other_libraries/#quantity-points-conversions).

Maybe quantity_point_like_traits should also require to_numerical_value and from_numerical_value?