From 5d6fefdd2acd70c34d8ba4590ab888d8481532af Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Sat, 16 Apr 2022 11:14:41 -0400 Subject: [PATCH] Protect against MSVC min and max macros --- include/boost/static_string/static_string.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/static_string/static_string.hpp b/include/boost/static_string/static_string.hpp index 7d2d87f..d1f4943 100644 --- a/include/boost/static_string/static_string.hpp +++ b/include/boost/static_string/static_string.hpp @@ -350,10 +350,10 @@ integer_to_string( } if (value < 0) { - const bool is_min = value == std::numeric_limits::min(); + const bool is_min = value == (std::numeric_limits::min)(); // negation of a min value cannot be represented if (is_min) - value = std::numeric_limits::max(); + value = (std::numeric_limits::max)(); else value = -value; const auto last_char = str_end - 1; @@ -405,10 +405,10 @@ integer_to_wstring( } if (value < 0) { - const bool is_min = value == std::numeric_limits::min(); + const bool is_min = value == (std::numeric_limits::min)(); // negation of a min value cannot be represented if (is_min) - value = std::numeric_limits::max(); + value = (std::numeric_limits::max)(); else value = -value; const auto last_char = str_end - 1;