-
Notifications
You must be signed in to change notification settings - Fork 10
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
π§βπ¬ Make sure safe arithmetic works with a dimensional analysis library (like mpusz/units) #8
Comments
lukevalenty
changed the title
β¨ Add support for requirements extensions (units)
π§βπ¬ Make sure safe arithmetic works with a dimensional analysis library (like mpusz/units)
Nov 30, 2022
Some notes on how this might work. safe::var<int, ival<0, 1023>, km / h> current_speed = 100_s32 * km / h;
constexpr auto speed_limit = 100_s32 * km / h; units::some_type<safe::var<int, ival<0, 1023>>> current_speed = 100_s32 * km / h;
safe::var<unit::some_type<int, km / h>, ival<0, 1023>> current_speed = 100_s32 * km / h;
units::some_type<safe::var<int, ival<100, 100>>> |
another variation of the top that does a better job satisfying the DRY principle: auto current_speed = s32_ival<0, 1023>{100_s32} * km / h; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: