- chrono[meta header]
- std::chrono[meta namespace]
- year_month_weekday[meta class]
- function[meta id-type]
- cpp20[meta cpp]
constexpr chrono::weekday_indexed weekday_indexed() const noexcept; // (1) C++20- chrono::weekday_indexed[link /reference/chrono/weekday_indexed.md]
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]);
}- date.weekday_indexed()[color ff0000]
- chrono::weekday_indexed[link /reference/chrono/weekday_indexed.md]
- 2020y[link /reference/chrono/year/op_y.md]
- chrono::Sunday[link /reference/chrono/weekday_constants.md]
- C++20
- Clang: 8.0
- GCC: 11.1
- Visual C++: (2019 Update 3時点で実装なし)