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

履歴 編集

function
<chrono>

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

constexpr unsigned int index() const noexcept; // (1) C++20

概要

インデックスを取得する。

戻り値

コンストラクタで設定されて保持している曜日のインデックスを返す。

#include <cassert>
#include <chrono>

namespace chrono = std::chrono;

int main()
{
  chrono::weekday_indexed wi = chrono::Sunday[1];
  unsigned int index = wi.index();

  assert(index == 1);
}

出力

バージョン

言語

  • C++20

処理系

  • Clang: 8.0
  • GCC: (9.2時点で実装なし)
  • Visual C++: (2019 Update 3時点で実装なし)