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