-
Notifications
You must be signed in to change notification settings - Fork 56
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
Reenable fma #56
base: develop
Are you sure you want to change the base?
Reenable fma #56
Conversation
@mborland, @jzmaddock, @swatanabe : Could your review? Couldn't figure out how to get this one to compile:
but . . . perfect is the enemy of the good. |
It seems reasonable to me. I think something of note if it's not already known is this transitively requires C++14 since |
If you wanted to handle all of the mixed argument cases (there are a lot!), then the only sensible way to do it is to provide one fma template that is enable_if'd on at least one of the template parameters being a unit. Then in the body you need to call an "unwrap" helper function that returns the result of argN.value() when argN is a unit, and simply argN otherwise. Hope that all makes sense! |
LGTM.
The other mixed argument cases are not necessary. Multiplication of a
quantity by a scalar is allowed. Addition of a quantity and a scalar is not.
|
These were added due to a compile error I observed on a Horner's algorithm where the abscissa is dimensionless and the coefficients are dimensioned. The compile error when only enabling the original overload is as follows:
Code:
Compiler:
|
@swatanabe : Mind merging? |
No description provided.