27 Time library [time]

27.8 The civil calendar [time.cal]

27.8.10 Class month_­day_­last [time.cal.mdlast]

namespace std::chrono {
  class month_day_last {
    chrono::month m_;                   // exposition only

  public:
    constexpr explicit month_day_last(const chrono::month& m) noexcept;

    constexpr chrono::month month() const noexcept;
    constexpr bool ok() const noexcept;
  };
}
month_­day_­last represents the last day of a month.
[Note
:
A month_­day_­last object can be constructed using the expression m/last or last/m, where m is an expression of type month.
— end note
]
[Example
:
constexpr auto mdl = February/last;     // mdl is the last day of February of an as yet unspecified year
static_assert(mdl.month() == February);
— end example
]
month_­day_­last is a trivially copyable and standard-layout class type.
constexpr explicit month_day_last(const chrono::month& m) noexcept;
Effects: Initializes m_­ with m.
constexpr month month() const noexcept;
Returns: m_­.
constexpr bool ok() const noexcept;
Returns: m_­.ok().
constexpr bool operator==(const month_day_last& x, const month_day_last& y) noexcept;
Returns: x.month() == y.month().
constexpr strong_ordering operator<=>(const month_day_last& x, const month_day_last& y) noexcept;
Returns: x.month() <=> y.month().
template<class charT, class traits> basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const month_day_last& mdl);
Effects: Equivalent to:
return os << format(os.getloc(), STATICALLY-WIDEN<charT>("{}/last"), mdl.month());