#include "sim/mathexpr.hh"
#include <algorithm>
+#include <cmath>
#include <regex>
#include <string>
MathExpr::MathExpr(std::string expr)
: ops(
- std::array<OpSearch, uNeg + 1> {
+ std::array<OpSearch, uNeg + 1> {{
OpSearch {true, bAdd, 0, '+', [](double a, double b) { return a + b; }},
OpSearch {true, bSub, 0, '-', [](double a, double b) { return a - b; }},
OpSearch {true, bMul, 1, '*', [](double a, double b) { return a * b; }},
OpSearch {false,uNeg, 2, '-', [](double a, double b) { return -b; }},
OpSearch {true, bPow, 3, '^', [](double a, double b) {
return std::pow(a,b); }
- },
+ }},
})
{
// Cleanup