mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-18 19:48:44 +02:00
extract variable
This commit is contained in:
@@ -852,9 +852,11 @@ bool Value::asBool() const {
|
||||
return value_.int_ ? true : false;
|
||||
case uintValue:
|
||||
return value_.uint_ ? true : false;
|
||||
case realValue:
|
||||
// According to JavaScript language zero or NaN is regarded as false
|
||||
return std::fpclassify(value_.real_) != FP_ZERO && std::fpclassify(value_.real_) != FP_NAN;
|
||||
case realValue: {
|
||||
// According to JavaScript language zero or NaN is regarded as false
|
||||
const auto value_classification = std::fpclassify(value_.real_);
|
||||
return value_classification != FP_ZERO && value_classification != FP_NAN;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user