class
std::chrono::year_month_day_last(C++20)
namespace std::chrono {
class year_month_day_last;
}
概要
year_month_day_last
は、年、月、月の最終日を表すカレンダー表現のためクラスである。
このクラスは、年、および月に関する演算に対応している。ただし、日に関する演算はできない。
このクラスは等値比較および大小比較ができ、EqualityComparableおよびLessThanComparableの要件を満たす。
このクラスは、トリビアルコピー可能で、かつスタンダードレイアウト型である。
メンバ関数
構築/コピー/破棄
名前 |
説明 |
対応バージョン |
(constructor) |
コンストラクタ |
C++20 |
year_month_day_last& operator=(const year_month_day_last&) = default; year_month_day_last& operator=(year_month_day_last&&) = default; |
代入演算子 |
C++20 |
算術演算
観測
変換
検証
名前 |
説明 |
対応バージョン |
ok |
値が範囲に収まっているか判定する |
C++20 |
非メンバ関数
算術演算
比較演算
名前 |
説明 |
対応バージョン |
operator== |
等値比較を行う |
C++20 |
bool operator!=(const year_month_day_last&, const year_month_day_last&) noexcept; |
非等値比較を行う (== により使用可能) |
C++20 |
operator<=> |
三方比較を行う |
C++20 |
bool operator<(const year_month_day_last&, const year_month_day_last&) noexcept; |
左辺が右辺より小さいかを判定する (<=> により使用可能) |
C++20 |
bool operator<=(const year_month_day_last&, const year_month_day_last&) noexcept; |
左辺が右辺以下を判定する (<=> により使用可能) |
C++20 |
bool operator>(const year_month_day_last&, const year_month_day_last&) noexcept; |
左辺が右辺より大きいかを判定する (<=> により使用可能) |
C++20 |
bool operator>=(const year_month_day_last&, const year_month_day_last&) noexcept; |
左辺が右辺以上を判定する (<=> により使用可能) |
C++20 |
入出力
文字列フォーマットサポート
ハッシュサポート
名前 |
説明 |
対応バージョン |
template <class T> struct hash; |
hash クラスの先行宣言 |
C++26 |
template<> struct hash<chrono::year_month_day_last>; |
hash クラスのyear_month_day_last に対する特殊化 |
C++26 |
例
出力
2020/02/last
29
2020-02-29
2020-02-29
バージョン
言語
処理系
参照