最終更新日時(UTC):
が更新

履歴 編集

function
<chrono>

std::chrono::operator/(C++20)

namespace std::chrono {
  constexpr year_month_weekday
    operator/(const month_weekday& mwd, const year& y) noexcept; // (1) C++20

  constexpr year_month_weekday
    operator/(const month_weekday& mwd, int y) noexcept;         // (2) C++20
}

概要

カレンダー要素同士をつなぎ合わせる。

  • (1) : month_weekday型とyear型をつなぎ、年月の指定したN回目の曜日の情報をもつ型にまとめる
  • (2) : month_weekday型とint型での年の値をつなぎ、年月の指定したN回目の曜日の情報をもつ型にまとめる

戻り値

  • (1) : return y / mwd;
  • (2) : return year{y} / mwd;

例外

投げない

#include <cassert>
#include <chrono>

using namespace std::chrono;

int main()
{
  assert((March/Sunday[1])/2020y == (year_month_weekday{2020y, March, Sunday[1]}));
  assert((March/Sunday[1])/2020 == (year_month_weekday{2020y, March, Sunday[1]}));
}

出力

バージョン

言語

  • C++20

処理系