次の方法で共有


month_day_last クラス

月の最後の日を表します。

構文

class month_day_last; // C++20

メンバー

名前 説明
コンストラクター month_day_last を構築します
month 月の値を返します。
ok この month_day が有効かどうかを確認します。

非メンバー

名前 説明
operator== 2 つの month_days が等しいかどうかを判断します。
operator<=> この month_day を別の month_day と比較します。 演算子 >, >=, <=, <, != はコンパイラによって合成されます。
operator<< 指定したストリームに month_day を出力します。

要件

ヘッダー:<chrono> (C++20 以降)

名前空間std::chrono:

コンパイラ オプション:/std:c++latest

Constructor

month_day_last インスタンスを構築します。

constexpr explicit month_day_last(const month& m) noexcept;

パラメーター

m
m で指定された月の month_day_last を構築します。

解説

日付の指定に使用される 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;

戻り値

この month_day_last の month 値が有効な場合は true です。 それ以外の場合は false

関連項目

<chrono>
month クラス
month_day クラス
month_day_last クラス
month_weekday クラス
month_weekday_last クラス
operator/ヘッダー ファイル リファレンス