From 7a8a158857914fd093d596cd1084583c0d3191e5 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 30 Oct 2019 14:05:52 -0400 Subject: [PATCH] Protected std::min/max calls --- include/boost/fixed_string/detail/fixed_string.hpp | 2 -- include/boost/fixed_string/impl/fixed_string.hpp | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/boost/fixed_string/detail/fixed_string.hpp b/include/boost/fixed_string/detail/fixed_string.hpp index f5efac6..5e66c76 100644 --- a/include/boost/fixed_string/detail/fixed_string.hpp +++ b/include/boost/fixed_string/detail/fixed_string.hpp @@ -11,7 +11,6 @@ #define BOOST_FIXED_STRING_DETAIL_FIXED_STRING_HPP #include -#include #include #include @@ -151,7 +150,6 @@ inline CharT* raw_to_string(CharT* last, std::size_t size, Integer i) { - boost::ignore_unused(size); BOOST_FIXED_STRING_ASSERT(size >= max_digits(sizeof(Integer))); return raw_to_string( last, i, std::is_signed{}); diff --git a/include/boost/fixed_string/impl/fixed_string.hpp b/include/boost/fixed_string/impl/fixed_string.hpp index 2fe3930..d5d3bfb 100644 --- a/include/boost/fixed_string/impl/fixed_string.hpp +++ b/include/boost/fixed_string/impl/fixed_string.hpp @@ -589,7 +589,7 @@ replace( if (pos > size()) BOOST_FIXED_STRING_THROW(std::out_of_range{ "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{ "replaced string exceeds max_size()"}); if (pos + n1 >= size()) @@ -638,7 +638,7 @@ replace( if (pos > size()) BOOST_FIXED_STRING_THROW(std::out_of_range{ "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{ "replaced string exceeds max_size()"}); if (pos + n1 >= size())