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

履歴 編集

function
<chrono>

std::chrono::year_month_weekday::weekday_indexed(C++20)

constexpr chrono::weekday_indexed weekday_indexed() const noexcept; // (1) C++20

概要

N回目の曜日要素を取得する。

戻り値

コンストラクタで設定されて保持しているN回目の曜日オブジェクトを返す。

#include <cassert>
#include <chrono>

namespace chrono = std::chrono;
using namespace std::chrono_literals;

int main()
{
  chrono::year_month_weekday date = 2020y/3/chrono::Sunday[2];
  chrono::weekday_indexed wdi = date.weekday_indexed();
  assert(wdi == chrono::Sunday[2]);
}

出力

バージョン

言語

  • C++20

処理系