-
Notifications
You must be signed in to change notification settings - Fork 78
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 we add zero_Celsius
point origin?
#506
Comments
I would say: 'zero_Celsius' is a synonym (or alias) for 'si::ice_point' and not a (derived) kind of a 'si::ice_point'. |
I didn't mean it to be treated as a derived thing. Inheritance here is just an implementation detail to create a strongly typed name. We do it for other entities as well. For example:
so what I meant was something like this: inline constexpr struct zero_Celsius : decltype(ice_point) {} zero_Celsius; but we can also do: inline constexpr ice_point zero_Celsius; which will not introduce a new type, and the user will still see |
Kelvin is a unit.
Yes, that is true. Subtracting two points gives a quantity. As those are the same points, the distance between them is zero. The only exception when we can't subtract two points is when they are |
For posterity, here's my take on this issue (as shared in our recent WG21 meeting):
|
Done some time ago |
Yesterday, I stumbled upon this article: https://randomascii.wordpress.com/2023/10/17/localization-failure-temperature-is-hard/
and prototyped the following solution for it: https://godbolt.org/z/6jo6xqeb8.
Even though the "ice point" is the correct name for the beginning of the Celsius scale, it looks a bit inconsistent and harder to use compared to Fahrenheits:
Should we add
zero_Celsius
as an alias forsi::ice_point
as well to improve the usability? If so, should thezero_Celsius
be its own strong type (derived fromsi::ice_point
) or is it enough to just make it an object ofsi::ice_point
type. The difference will be visible in types presented in compile-time errors.The text was updated successfully, but these errors were encountered: