27 Time library [time]

27.8 The civil calendar [time.cal]

27.8.16 Class year_Β­month_Β­weekday [time.cal.ymwd]

27.8.16.2 Member functions [time.cal.ymwd.members]

constexpr year_month_weekday(const chrono::year& y, const chrono::month& m, const chrono::weekday_indexed& wdi) noexcept;
Effects: Initializes y_Β­ with y, m_Β­ with m, and wdi_Β­ with wdi.
constexpr year_month_weekday(const sys_days& dp) noexcept;
Effects: Constructs an object of type year_Β­month_Β­weekday which corresponds to the date represented by dp.
Remarks: For any value ymdl of type year_Β­month_Β­weekday for which ymdl.ok() is true, ymdl == year_Β­month_Β­weekday{sys_Β­days{ymdl}} is true.
constexpr explicit year_month_weekday(const local_days& dp) noexcept;
Effects: Equivalent to constructing with sys_Β­days{dp.time_Β­since_Β­epoch()}.
constexpr year_month_weekday& operator+=(const months& m) noexcept;
Constraints: If the argument supplied by the caller for the months parameter is convertible to years, its implicit conversion sequence to years is worse than its implicit conversion sequence to months ([over.ics.rank]).
Effects: *this = *this + m.
Returns: *this.
constexpr year_month_weekday& operator-=(const months& m) noexcept;
Constraints: If the argument supplied by the caller for the months parameter is convertible to years, its implicit conversion sequence to years is worse than its implicit conversion sequence to months ([over.ics.rank]).
Effects: *this = *this - m.
Returns: *this.
constexpr year_month_weekday& operator+=(const years& y) noexcept;
Effects: *this = *this + y.
Returns: *this.
constexpr year_month_weekday& operator-=(const years& y) noexcept;
Effects: *this = *this - y.
Returns: *this.
constexpr chrono::year year() const noexcept;
Returns: y_Β­.
constexpr chrono::month month() const noexcept;
Returns: m_Β­.
constexpr chrono::weekday weekday() const noexcept;
Returns: wdi_Β­.weekday().
constexpr unsigned index() const noexcept;
Returns: wdi_Β­.index().
constexpr chrono::weekday_indexed weekday_indexed() const noexcept;
Returns: wdi_Β­.
constexpr operator sys_days() const noexcept;
Returns: If y_Β­.ok() && m_Β­.ok() && wdi_Β­.weekday().ok(), returns a sys_Β­days that represents the date (index() - 1) * 7 days after the first weekday() of year()/month().
If index() is 0 the returned sys_Β­days represents the date 7 days prior to the first weekday() of year()/month().
Otherwise the returned value is unspecified.
constexpr explicit operator local_days() const noexcept;
Returns: local_Β­days{sys_Β­days{*this}.time_Β­since_Β­epoch()}.
constexpr bool ok() const noexcept;
Returns: If any of y_Β­.ok(), m_Β­.ok(), or wdi_Β­.ok() is false, returns false.
Otherwise, if *this represents a valid date, returns true.
Otherwise, returns false.