Closed kunaltyagi closed 6 years ago
Greetings.
The units' name use their singular spelling appended with _t
, so in this case the correct code reads:
using namespace units::literals;
const units::time::nanosecond_t min_delay = 5_ms;
const units::time::nanosecond_t max_delay = 50.0_ms;
Thanks for this I had been using auto along with literals so didn't run into this issue before.
This was a very dumb oversight on my part. Somehow my brain decided not to look at '_t'
@kunaltyagi I'm really glad you logged this as an issue, I think it shows us that we're moving in the right direction with our name refactoring.
Both variable declaration lines in the following snippet give build time error:
Error is due to no viable conversion, however, I don't understand why the conversion is not possible (for integral values, std::chrono defines the conversions, but I'm hoping to use floating point values also)
Compiler: clang v6.0.0 Units: HEAD@master
PS: the compiler tried matching it with std::chrono so maybe in future, we might get collisions with std::chrono unless my compiler just checked std::chrono because it wanted to.
EDIT:
Ran the test, and all tests succeed except UnitContainer.to_string_locale and that's my own fault.