C++ Mathematical Expression Library (ExprTk) http://www.partow.net/programming/exprtk/index.html

This commit is contained in:
Arash Partow 2015-04-30 23:21:26 +10:00
parent 8a2fc65e0a
commit d7dfe94e11
1 changed files with 12 additions and 2 deletions

View File

@ -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