Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 930 Bytes

File metadata and controls

49 lines (37 loc) · 930 Bytes

index

  • chrono[meta header]
  • std::chrono[meta namespace]
  • weekday_indexed[meta class]
  • function[meta id-type]
  • cpp20[meta cpp]
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);
}
  • index()[color ff0000]
  • chrono::Sunday[link /reference/chrono/weekday_constants.md]

出力

バージョン

言語

  • C++20

処理系

  • Clang: 8.0 [mark verified]
  • GCC: 9.2 [mark noimpl]
  • Visual C++: 2019 Update 3 [mark noimpl]