Skip to content

Commit

Permalink
Replace struct powOp by lambda powImpl
Browse files Browse the repository at this point in the history
This is more consistent with how we do it for the other function + it
should address the SonarCloud issue.
  • Loading branch information
Hannah Bast committed Oct 12, 2024
1 parent 854b81f commit c7e1da3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/engine/sparqlExpressions/NumericBinaryExpressions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@ inline auto subtract = makeNumericExpression<std::minus<>>();
NARY_EXPRESSION(SubtractExpression, 2,
FV<decltype(subtract), NumericValueGetter>);

// Power
struct powOp {
constexpr double operator()(const double base, const double exp) {
return std::pow(base, exp);
}
// Power.
inline auto powImpl = [](double base, double exp) {
return std::pow(base, exp);
};
inline auto pow = makeNumericExpression<powOp>();
inline auto pow = makeNumericExpression<decltype(powImpl)>();
NARY_EXPRESSION(PowExpression, 2, FV<decltype(pow), NumericValueGetter>);

// Or
Expand Down

0 comments on commit c7e1da3

Please sign in to comment.