Files
2025-10-25 03:02:53 +03:00

3.0 KiB

[time.cal.mdlast]

30 Time library [time]

30.8 The civil calendar [time.cal]

30.8.10 Class month_day_last [time.cal.mdlast]

namespace std::chrono {class month_day_last { chrono::month m_; // exposition onlypublic:constexpr explicit month_day_last(const chrono::month& m) noexcept; constexpr chrono::month month() const noexcept; constexpr bool ok() const noexcept; };}

1

#

month_day_last represents the last day of a month.

2

#

[Note 1:

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 1: constexpr auto mdl = February/last; // mdl is the last day of February of an as yet unspecified yearstatic_assert(mdl.month() == February); — end example]

3

#

month_day_last is a trivially copyable and standard-layout class type.

🔗

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

4

#

Effects: Initializes m_ with m.

🔗

constexpr month month() const noexcept;

5

#

Returns: m_.

🔗

constexpr bool ok() const noexcept;

6

#

Returns: m_.ok().

🔗

constexpr bool operator==(const month_day_last& x, const month_day_last& y) noexcept;

7

#

Returns: x.month() == y.month().

🔗

constexpr strong_ordering operator<=>(const month_day_last& x, const month_day_last& y) noexcept;

8

#

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);

9

#

Effects: Equivalent to:return os << format(os.getloc(), STATICALLY-WIDEN("{:L}/last"), mdl.month());