Use value_in_range_of trait
This commit is contained in:
parent
329e1871f7
commit
d84ac2a148
@ -2079,7 +2079,7 @@ class binary_reader
|
||||
return sax->parse_error(chars_read, get_token_string(), parse_error::create(113, chars_read,
|
||||
exception_message(input_format, "count in an optimized container must be positive", "size"), nullptr));
|
||||
}
|
||||
if (number > std::numeric_limits<std::size_t>::max())
|
||||
if (!value_in_range_of<std::size_t>(number))
|
||||
{
|
||||
return sax->parse_error(chars_read, get_token_string(), parse_error::create(408, chars_read,
|
||||
exception_message(input_format, "integer value overflow", "size"), nullptr));
|
||||
@ -2129,7 +2129,7 @@ class binary_reader
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (number > std::numeric_limits<std::size_t>::max())
|
||||
if (!value_in_range_of<std::size_t>(number))
|
||||
{
|
||||
return sax->parse_error(chars_read, get_token_string(), parse_error::create(408, chars_read,
|
||||
exception_message(input_format, "integer value overflow", "size"), nullptr));
|
||||
|
||||
@ -10764,7 +10764,7 @@ class binary_reader
|
||||
return sax->parse_error(chars_read, get_token_string(), parse_error::create(113, chars_read,
|
||||
exception_message(input_format, "count in an optimized container must be positive", "size"), nullptr));
|
||||
}
|
||||
if (number > std::numeric_limits<std::size_t>::max())
|
||||
if (!value_in_range_of<std::size_t>(number))
|
||||
{
|
||||
return sax->parse_error(chars_read, get_token_string(), parse_error::create(408, chars_read,
|
||||
exception_message(input_format, "integer value overflow", "size"), nullptr));
|
||||
@ -10814,7 +10814,7 @@ class binary_reader
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (number > std::numeric_limits<std::size_t>::max())
|
||||
if (!value_in_range_of<std::size_t>(number))
|
||||
{
|
||||
return sax->parse_error(chars_read, get_token_string(), parse_error::create(408, chars_read,
|
||||
exception_message(input_format, "integer value overflow", "size"), nullptr));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user