diff --git a/date.html b/date.html index 11a9a40..78e58b2 100644 --- a/date.html +++ b/date.html @@ -3220,7 +3220,6 @@ public: constexpr weekday& operator+=(const days& d) noexcept; constexpr weekday& operator-=(const days& d) noexcept; - constexpr explicit operator unsigned() const noexcept; constexpr bool ok() const noexcept; constexpr weekday_indexed operator[](unsigned index) const noexcept; constexpr weekday_last operator[](last_spec) const noexcept; @@ -3249,27 +3248,27 @@ from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt, w std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr, std::chrono::minutes* offset = nullptr); -constexpr weekday Sunday{0}; constexpr weekday Monday{1}; constexpr weekday Tuesday{2}; constexpr weekday Wednesday{3}; constexpr weekday Thursday{4}; constexpr weekday Friday{5}; constexpr weekday Saturday{6}; +constexpr weekday Sunday{7};
Overview
-weekday
represents a day of the week in the Gregorian calendar. It should
-only be representing values in the range 0 to 6, corresponding to Sunday thru Saturday.
-However it may hold values outside this range. It can be constructed with any
+weekday
represents a day of the week in the Gregorian calendar.
+It can be constructed with any
unsigned
value, which will be subsequently truncated to fit into
-weekday
's internal storage. weekday
is equality comparable.
+weekday
's internal storage. The values [1, 6] map to Monday thru Saturday.
+Both 0 and 7 map to Sunday. Other values in the range [8, 255] will be stored, and will
+represent values of weekday
that are !ok()
.
+weekday
is equality comparable.
weekday
is not less-than comparable because there is no universal consensus
-on which day is the first day of the week. This design chooses the encoding of 0 to 6 to
-represent Sunday thru Saturday only because this is consistent with existing C and C++
-practice. However weekday
's comparison and arithmetic operations treat the
+on which day is the first day of the week. weekday
's comparison and arithmetic operations treat the
days of the week as a circular range, with no beginning and no end. One can stream out a
weekday
for debugging purposes. weekday
has explicit conversions
to and from unsigned
. There are 7 weekday
constants, one for each
@@ -3301,9 +3300,14 @@ explicit constexpr weekday::weekday(unsigned wd) noexcept;
@@ -3421,23 +3425,14 @@ constexpr weekday& weekday::operator-=(const days& d) noexcept; --Effects: Constructs an object of type
weekday
by constructing -wd_
withwd
. The value held is unspecified ifwd
-is not in the range[0, 255]
. +Effects: Constructs an object of typeweekday
+which represents a day of the week according to the ISO 8601 mapping +of integers to days of the week. Additionally, ifwd == +0
, Sunday is represented. [Note: Sunday can be +constructed from both 0 and 7 — end note]. If +wd
is in the range [8, 255],wd_
is +initialized with wd. If wd is not in the range [0, 255], the value +held is unspecified.
-constexpr explicit weekday::operator unsigned() const noexcept; -- -
---Returns:
-wd_
. -
constexpr bool weekday::ok() const noexcept;
@@ -3467,7 +3462,7 @@ constexpr bool operator==(const weekday& x, const weekday& y) noexcept;-Returns:
wd_ <= 6
. +Returns:true
if*this
holds a value in the range +Monday thru Sunday, else returnsfalse
.
-Returns:
unsigned{x} == unsigned{y}
. +Returns:x.wd_ == y.wd_
.