-
Notifications
You must be signed in to change notification settings - Fork 97
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
Implement operations for Quantity references #38
Comments
Are there any difficulties or pitfalls here, or is it just a fairly mechanical process that simply requires finding the time to do it? If it's the latter, I'll start chipping away at it. If it's the former, I could also have a go, if you brief me. |
Should be completely mechanical. Implementation would start with the following macros Lines 588 to 591 in 66d3e85
And you can compare against what the standard library is doing for inspiration on implementing for Once the major traits are implemented we can go hunting to see if there is anything else like |
Just to be sure: Are you suggesting to add the implementations of the reference versions, to the bodies of those macros? I don't quite understand the pattern inside the macro. First we have this group of 4:
followed by another group of 4:
Why is there an asymmetry between the |
I apologize for taking so long to get to this. I'll look at the PR in a second to see what you've done so far. The original thought was to do something to the standard library and use a macro that accepts the type ( The asymmetry is because multiply and divide allow for operating on the underlying storage type as well as the quantity. e.g. |
impl Op<Quantity<...>> for Quantity<..>
is already complete. Add the following reference implementations:impl<'a, 'b> Op<&'a Quantity<...>> for &'b Quantity<..>
impl<'a> Op<&'a Quantity<...>> for Quantity<..>
impl<'a> Op<Quantity<...>> for &'a Quantity<..>
The text was updated successfully, but these errors were encountered: