[time.cal.wd.members] (original) (raw)

30 Time library [time]

30.8 The civil calendar [time.cal]

30.8.6 Class weekday [time.cal.wd]

30.8.6.2 Member functions [time.cal.wd.members]

constexpr explicit weekday(unsigned wd) noexcept;

Effects: Initializes wd_ with wd == 7 ? 0 : wd.

The value held is unspecified if wd is not in the range [0, 255].

constexpr weekday(const sys_days& dp) noexcept;

Effects: Computes what day of the week corresponds to the sys_days dp, and initializes that day of the week in wd_.

[Example 1:

If dp represents 1970-01-01, the constructed weekday represents Thursday by storing 4 in wd_.

— _end example_]

constexpr explicit weekday(const local_days& dp) noexcept;

Effects: Computes what day of the week corresponds to the local_days dp, and initializes that day of the week in wd_.

Postconditions: The value is identical to that constructed fromsys_days{dp.time_since_epoch()}.

constexpr weekday& operator++() noexcept;

Effects: *this += days{1}.

constexpr weekday operator++(int) noexcept;

Returns: A copy of *this as it existed on entry to this member function.

constexpr weekday& operator--() noexcept;

Effects: *this -= days{1}.

constexpr weekday operator--(int) noexcept;

Returns: A copy of *this as it existed on entry to this member function.

constexpr weekday& operator+=(const days& d) noexcept;

Effects: *this = *this + d.

constexpr weekday& operator-=(const days& d) noexcept;

Effects: *this = *this - d.

constexpr unsigned c_encoding() const noexcept;

constexpr unsigned iso_encoding() const noexcept;

Returns: wd_ == 0u ? 7u : wd_.

constexpr bool ok() const noexcept;

constexpr weekday_indexed operator[](unsigned index) const noexcept;

constexpr weekday_last operator[](last_spec) const noexcept;

Returns: weekday_last{*this}.