Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should quantity_point_like_traits work on raw values? #531

Open
mpusz opened this issue Dec 18, 2023 · 0 comments
Open

Should quantity_point_like_traits work on raw values? #531

mpusz opened this issue Dec 18, 2023 · 0 comments
Labels
design Design-related discussion question Further information is requested

Comments

@mpusz
Copy link
Owner

mpusz commented Dec 18, 2023

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 mpusz added question Further information is requested design Design-related discussion labels Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Design-related discussion question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant