Skip to content

Commit

Permalink
MSVC version greater 17.7.1 would give errors for civil_time_detail.h (
Browse files Browse the repository at this point in the history
…google#273)

The compiler cannot identify (max) as a trick to prevent MACRO treatment. A trailing return type fixes this.
  • Loading branch information
wxinix-2022 authored Sep 6, 2023
1 parent 1261fab commit ffce47e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/cctz/civil_time_detail.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::int_least64_t>::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<std::int_least64_t>::min)();
return civil_time(min_year, 1, 1, 0, 0, 0);
}
Expand Down

0 comments on commit ffce47e

Please sign in to comment.