VariableExpression: Add converters for long and bool data types.
This commit is contained in:
parent
e9480e6a09
commit
22d77b784a
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user