C++ Mathematical Expression Library (ExprTk) http://www.partow.net/programming/exprtk/index.html
This commit is contained in:
parent
8a2fc65e0a
commit
d7dfe94e11
14
exprtk.hpp
14
exprtk.hpp
|
@ -170,6 +170,16 @@ namespace exprtk
|
||||||
is_digit(symbol[3]);
|
is_digit(symbol[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline const char& front(const std::string& s)
|
||||||
|
{
|
||||||
|
return s[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
inline const char& back(const std::string& s)
|
||||||
|
{
|
||||||
|
return s[s.size() - 1];
|
||||||
|
}
|
||||||
|
|
||||||
inline std::string to_str(int i)
|
inline std::string to_str(int i)
|
||||||
{
|
{
|
||||||
if (0 == i)
|
if (0 == i)
|
||||||
|
@ -32073,8 +32083,8 @@ namespace exprtk
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
('{' == expression.front()) &&
|
('{' == details::front(expression)) &&
|
||||||
('}' == expression.back ())
|
('}' == details::back (expression))
|
||||||
)
|
)
|
||||||
mod_expression += "~" + expression + ";";
|
mod_expression += "~" + expression + ";";
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue