From 35658bf42d6fc3eb2b3b5f78f85a0abd8f9b6817 Mon Sep 17 00:00:00 2001 From: Michael Winterberg Date: Tue, 24 Sep 2019 10:27:45 -0700 Subject: [PATCH 1/2] workaround VS2019 Update 3 compiler bug. --- include/fmt/safe-duration-cast.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/safe-duration-cast.h b/include/fmt/safe-duration-cast.h index 72ec07c56eb0..d97704199403 100644 --- a/include/fmt/safe-duration-cast.h +++ b/include/fmt/safe-duration-cast.h @@ -161,7 +161,7 @@ To safe_duration_cast(std::chrono::duration from, ec = 0; // the basic idea is that we need to convert from count() in the from type // to count() in the To type, by multiplying it with this: - using Factor = std::ratio_divide; + struct Factor : std::ratio_divide{}; static_assert(Factor::num > 0, "num must be positive"); static_assert(Factor::den > 0, "den must be positive"); @@ -232,7 +232,7 @@ To safe_duration_cast(std::chrono::duration from, // the basic idea is that we need to convert from count() in the from type // to count() in the To type, by multiplying it with this: - using Factor = std::ratio_divide; + struct Factor : std::ratio_divide{}; static_assert(Factor::num > 0, "num must be positive"); static_assert(Factor::den > 0, "den must be positive"); From c7d4af9b2c99ccd4f8dd2ba1df374036778ba305 Mon Sep 17 00:00:00 2001 From: Michael Winterberg Date: Tue, 24 Sep 2019 10:31:13 -0700 Subject: [PATCH 2/2] reformatted. --- include/fmt/safe-duration-cast.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/fmt/safe-duration-cast.h b/include/fmt/safe-duration-cast.h index d97704199403..38aef69b6f81 100644 --- a/include/fmt/safe-duration-cast.h +++ b/include/fmt/safe-duration-cast.h @@ -161,7 +161,8 @@ To safe_duration_cast(std::chrono::duration from, ec = 0; // the basic idea is that we need to convert from count() in the from type // to count() in the To type, by multiplying it with this: - struct Factor : std::ratio_divide{}; + struct Factor + : std::ratio_divide {}; static_assert(Factor::num > 0, "num must be positive"); static_assert(Factor::den > 0, "den must be positive"); @@ -232,7 +233,8 @@ To safe_duration_cast(std::chrono::duration from, // the basic idea is that we need to convert from count() in the from type // to count() in the To type, by multiplying it with this: - struct Factor : std::ratio_divide{}; + struct Factor + : std::ratio_divide {}; static_assert(Factor::num > 0, "num must be positive"); static_assert(Factor::den > 0, "den must be positive");