-
Notifications
You must be signed in to change notification settings - Fork 86
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
refactor!: replace one_rep with reference<D, U> #261
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!!! Thanks!
Please see my comments...
Note to self: Update docs. |
While it looks great in code, I'm not sure about updating the documentation from "unit constant(s)" to "reference(s)". I'll keep those as "unit reference(s)". |
"quantity references"? |
BTW, while adding Hidden Friends please always add: // Hidden Friends
// Below friend functions are to be found via argument-dependent lookup only See more in http://wg21.link/p1601. |
There's https://wg21.link/hidden.friends now. Should I still add that? |
Yes, I believe we should add those as later on it may be needed to provide appropriate |
The standard iterator and range adaptors have no such wording. [hidden.friends] makes that redundant. |
I believe that this paper was provided only recently and it is a recommendation for the upcoming proposals. Anyway, I hope we will be able to check this in practice in a few years from now ;-) |
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
All that's left is updating the docs. +And removing `width{0} / m` too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thanks!!!
template<QuantityValue Rep> | ||
[[nodiscard]] friend constexpr Quantity auto operator/(const Rep& lhs, reference) | ||
{ | ||
return lhs / quantity<D, U, Rep>::one(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is no use for this operator? Probably we should get rid of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess so. Right now, it's a shortcut for 33 / (1 * s)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I would also prefer to be explicit. With this our *
serves exactly as ⋅
in a quantity notation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So let's get rid of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. #262 does that.
Resolves #243.
Drive-by:
rad
unit constant.-Wshadow
and-Wmissing-braces
.