From ffce47e8923be7269a1f3055a3dc6ba5576a4563 Mon Sep 17 00:00:00 2001 From: Wuping Xin <116379570+wxinix-2022@users.noreply.github.com> Date: Wed, 6 Sep 2023 13:09:13 -0400 Subject: [PATCH] MSVC version greater 17.7.1 would give errors for civil_time_detail.h (#273) The compiler cannot identify (max) as a trick to prevent MACRO treatment. A trailing return type fixes this. --- include/cctz/civil_time_detail.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/cctz/civil_time_detail.h b/include/cctz/civil_time_detail.h index 2dab664..682f8e3 100644 --- a/include/cctz/civil_time_detail.h +++ b/include/cctz/civil_time_detail.h @@ -367,11 +367,11 @@ class civil_time { : civil_time(ct.f_) {} // Factories for the maximum/minimum representable civil_time. - static CONSTEXPR_F civil_time (max)() { + static CONSTEXPR_F auto (max)() -> civil_time { const auto max_year = (std::numeric_limits::max)(); return civil_time(max_year, 12, 31, 23, 59, 59); } - static CONSTEXPR_F civil_time (min)() { + static CONSTEXPR_F auto (min)() -> civil_time { const auto min_year = (std::numeric_limits::min)(); return civil_time(min_year, 1, 1, 0, 0, 0); }