VariableExpression: Add converters for long and bool data types.

This commit is contained in:
Eivind Kvedalen 2016-01-19 20:30:03 +01:00 committed by wmayer
parent e9480e6a09
commit 22d77b784a

View File

@ -1031,6 +1031,16 @@ Expression * VariableExpression::eval() const
return new NumberExpression(owner, ivalue);
}
else if (value.type() == typeid(long)) {
long lvalue = boost::any_cast<long>(value);
return new NumberExpression(owner, lvalue);
}
else if (value.type() == typeid(bool)) {
double bvalue = boost::any_cast<bool>(value) ? 1.0 : 0.0;
return new NumberExpression(owner, bvalue);
}
else if (value.type() == typeid(std::string)) {
std::string svalue = boost::any_cast<std::string>(value);