mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-15 15:16:47 +02:00
[Language Conformance] Use constexpr restriction in jsoncpp (#1005)
* use constexpr restriction in jsoncpp * remove TODO comment
This commit is contained in:
@@ -1548,12 +1548,11 @@ bool OurReader::decodeNumber(Token& token, Value& decoded) {
|
||||
if (isNegative)
|
||||
++current;
|
||||
|
||||
// TODO(issue #960): Change to constexpr
|
||||
static const auto positive_threshold = Value::maxLargestUInt / 10;
|
||||
static const auto positive_last_digit = Value::maxLargestUInt % 10;
|
||||
static const auto negative_threshold =
|
||||
static constexpr auto positive_threshold = Value::maxLargestUInt / 10;
|
||||
static constexpr auto positive_last_digit = Value::maxLargestUInt % 10;
|
||||
static constexpr auto negative_threshold =
|
||||
Value::LargestUInt(Value::minLargestInt) / 10;
|
||||
static const auto negative_last_digit =
|
||||
static constexpr auto negative_last_digit =
|
||||
Value::LargestUInt(Value::minLargestInt) % 10;
|
||||
|
||||
const auto threshold = isNegative ? negative_threshold : positive_threshold;
|
||||
|
Reference in New Issue
Block a user