Commit ae36b287 authored by Christopher Bruns's avatar Christopher Bruns
Browse files

Added parenthesis workaround for using std::min/max on Windows, to prevent compile error.

parent 86f95f4c
......@@ -992,7 +992,8 @@ public:
return new Min();
}
double evaluate(double* args, const std::map<std::string, double>& variables) const {
return std::min(args[0], args[1]);
// parens around (std::min) are workaround for horrible microsoft max/min macro trouble
return (std::min)(args[0], args[1]);
}
ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
};
......@@ -1014,7 +1015,8 @@ public:
return new Max();
}
double evaluate(double* args, const std::map<std::string, double>& variables) const {
return std::max(args[0], args[1]);
// parens around (std::min) are workaround for horrible microsoft max/min macro trouble
return (std::max)(args[0], args[1]);
}
ExpressionTreeNode differentiate(const std::vector<ExpressionTreeNode>& children, const std::vector<ExpressionTreeNode>& childDerivs, const std::string& variable) const;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment