-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Description
Describe the bug
Unit conversions which divide the underlying value by some integer are accepted without complaint for integer reps.
To Reproduce
Steps to reproduce the behavior:
SI::length_t<int, std::ratio<1>> x{3};
SI::length_t<int, std::ratio<12>> y = x;
std::cout << "x = " << x << "; y = " << y << "!\n";
For me, this prints:
x = 3 m; y = 0 m!
Expected behavior
This should be a compiler error. If the rep is integral, we should only permit conversions which multiply by an integer, since these will stay in the domain of the integers.
Screenshots
N/A
Desktop (please complete the following information):
- OS: Linux
- Browser: chrome
- Version: 22.04
Smartphone (please complete the following information):
N/A
Additional context
N/A
Metadata
Metadata
Assignees
Labels
No labels