mp-units icon indicating copy to clipboard operation
mp-units copied to clipboard

Should `quantity_point_like_traits` work on raw values?

Open mpusz opened this issue 6 months ago • 0 comments

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?

mpusz avatar Dec 18 '23 14:12 mpusz