From c7b69d949a8fd7426eed0b0e96ee4a7f57259c3c Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Fri, 8 Jun 2018 09:50:40 -0400 Subject: [PATCH] Change the encoding for an invalid weekday from 7 to 8 --- include/date/date.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/date/date.h b/include/date/date.h index f3cd7de..2907d8f 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -4306,7 +4306,7 @@ template struct fields { year_month_day ymd{nanyear/0/0}; - weekday wd{7u}; + weekday wd{8u}; time_of_day tod{}; bool has_tod = false; @@ -4341,7 +4341,7 @@ extract_weekday(std::basic_ostream& os, const fields& f { // fds does not contain a valid weekday os.setstate(std::ios::failbit); - return 7; + return 8; } weekday wd; if (fds.ymd.ok()) @@ -4351,7 +4351,7 @@ extract_weekday(std::basic_ostream& os, const fields& f { // fds.ymd and fds.wd are inconsistent os.setstate(std::ios::failbit); - return 7; + return 8; } } else @@ -6044,7 +6044,7 @@ from_stream(std::basic_istream& is, const CharT* fmt, CONSTDATA int not_a_minute = not_a_hour; CONSTDATA Duration not_a_second = Duration::min(); CONSTDATA int not_a_doy = 0; - CONSTDATA int not_a_weekday = 7; + CONSTDATA int not_a_weekday = 8; CONSTDATA int not_a_week_num = 100; CONSTDATA int not_a_ampm = -1; CONSTDATA minutes not_a_offset = minutes::min();