From 37dc495b9d519b7649c06bc2d85b46ed0e85f1ba Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 5 Dec 2018 06:22:18 -0800 Subject: [PATCH] Simplify MSVC workaround --- include/fmt/format.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 0d76ab61..a6a2457c 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2975,7 +2975,7 @@ class format_int { // Formats value in reverse and returns a pointer to the beginning. char *format_decimal(unsigned long long value) { - char *ptr = buffer_ + static_cast(BUFFER_SIZE) - 1; + char *ptr = buffer_ + (BUFFER_SIZE - 1); // Parens to workaround MSVC bug. while (value >= 100) { // Integer division is slow so do it for a group of two digits instead // of for every digit. The idea comes from the talk by Alexandrescu