month_day_last 類別

代表月份的最後一天。

語法

class month_day_last; // C++20

成員

名稱 描述
建構函式 建構 month_day_last
month 傳回月份值。
ok 檢查這 month_day 是否有效。

非成員

名稱 描述
operator== 判斷兩者 month_days 是否相等。
operator<=> month_day將此與另一個month_day比較。 運算子 >, >=, <=, <, != 是由編譯程式合成。
operator<< month_day將 輸出至指定的數據流。

需求

標頭: <chrono> (自C++20起)

命名空間std::chrono

編譯程序選項: /std:c++latest

建構函式

month_day_last建構 實例。

constexpr explicit month_day_last(const month& m) noexcept;

參數

m
month_day_last建構 指定月份的 m

備註

如需用來指定日期之C++20 語法的相關信息,請參閱 operator/

範例:建立 month_day_last

// compile using: /std:c++latest
#include <chrono>

using namespace std::chrono;

int main()
{
    month_day_last mdl{ October / last };
    std::cout << mdl;

    return 0;
}
Oct/last

month

傳回月份值。

constexpr month month() const noexcept;

傳回值

月份值。

ok

檢查儲存在此中的 month_day_last 月份是否有效。

constexpr bool ok() const noexcept;

傳回值

true 如果這個 month_day_last 中的月份值有效,則為 。 否則為 false

另請參閱

<chrono>
month 類別
month_day 類別
month_day_last 類別
month_weekday 類別
month_weekday_last 類別
operator/標頭檔參考