29 Time library [time]

29.8 The civil calendar [time.cal]

29.8.16 Class year_month_weekday [time.cal.ymwd]

29.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 ymwd of type year_month_weekday for which ymwd.ok() is true, ymwd == year_month_weekday{sys_days{ymwd}} 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.