forked from boostorg/static_string
Protected std::min/max calls
This commit is contained in:
@ -11,7 +11,6 @@
|
|||||||
#define BOOST_FIXED_STRING_DETAIL_FIXED_STRING_HPP
|
#define BOOST_FIXED_STRING_DETAIL_FIXED_STRING_HPP
|
||||||
|
|
||||||
#include <boost/fixed_string/config.hpp>
|
#include <boost/fixed_string/config.hpp>
|
||||||
#include <boost/core/ignore_unused.hpp>
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
@ -151,7 +150,6 @@ inline
|
|||||||
CharT*
|
CharT*
|
||||||
raw_to_string(CharT* last, std::size_t size, Integer i)
|
raw_to_string(CharT* last, std::size_t size, Integer i)
|
||||||
{
|
{
|
||||||
boost::ignore_unused(size);
|
|
||||||
BOOST_FIXED_STRING_ASSERT(size >= max_digits(sizeof(Integer)));
|
BOOST_FIXED_STRING_ASSERT(size >= max_digits(sizeof(Integer)));
|
||||||
return raw_to_string<CharT, Integer, Traits>(
|
return raw_to_string<CharT, Integer, Traits>(
|
||||||
last, i, std::is_signed<Integer>{});
|
last, i, std::is_signed<Integer>{});
|
||||||
|
@ -589,7 +589,7 @@ replace(
|
|||||||
if (pos > size())
|
if (pos > size())
|
||||||
BOOST_FIXED_STRING_THROW(std::out_of_range{
|
BOOST_FIXED_STRING_THROW(std::out_of_range{
|
||||||
"pos > size()"});
|
"pos > size()"});
|
||||||
if (size() - std::min(n1, size() - pos) >= max_size() - n2)
|
if (size() - (std::min)(n1, size() - pos) >= max_size() - n2)
|
||||||
BOOST_FIXED_STRING_THROW(std::length_error{
|
BOOST_FIXED_STRING_THROW(std::length_error{
|
||||||
"replaced string exceeds max_size()"});
|
"replaced string exceeds max_size()"});
|
||||||
if (pos + n1 >= size())
|
if (pos + n1 >= size())
|
||||||
@ -638,7 +638,7 @@ replace(
|
|||||||
if (pos > size())
|
if (pos > size())
|
||||||
BOOST_FIXED_STRING_THROW(std::out_of_range{
|
BOOST_FIXED_STRING_THROW(std::out_of_range{
|
||||||
"pos > size()"});
|
"pos > size()"});
|
||||||
if (size() - std::min(n1, size() - pos) >= max_size() - n2)
|
if (size() - (std::min)(n1, size() - pos) >= max_size() - n2)
|
||||||
BOOST_FIXED_STRING_THROW(std::length_error{
|
BOOST_FIXED_STRING_THROW(std::length_error{
|
||||||
"replaced string exceeds max_size()"});
|
"replaced string exceeds max_size()"});
|
||||||
if (pos + n1 >= size())
|
if (pos + n1 >= size())
|
||||||
|
Reference in New Issue
Block a user