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.