[time.cal.wdidx.overview]

# 30 Time library [[time]](./#time)

## 30.8 The civil calendar [[time.cal]](time.cal#wdidx.overview)

### 30.8.7 Class weekday_indexed [[time.cal.wdidx]](time.cal.wdidx#overview)

#### 30.8.7.1 Overview [time.cal.wdidx.overview]

namespace std::chrono {class weekday_indexed { chrono::weekday wd_; // *exposition only*unsigned char index_; // *exposition only*public: weekday_indexed() = default; constexpr weekday_indexed(const chrono::weekday& wd, unsigned index) noexcept; constexpr chrono::weekday weekday() const noexcept; constexpr unsigned index() const noexcept; constexpr bool ok() const noexcept; };}

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L5286)

weekday_indexed represents a weekday and a small index in the range 1 to 5[.](#1.sentence-1)

This class is used to represent the
first, second, third, fourth, or fifth weekday of a month[.](#1.sentence-2)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L5292)

[*Note [1](#note-1)*:

A weekday_indexed object
can be constructed by indexing a weekday with an unsigned[.](#2.sentence-1)

â *end note*]

[*Example [1](#example-1)*: constexpr auto wdi = Sunday[2]; // wdi is the second Sunday of an as yet unspecified monthstatic_assert(wdi.weekday() == Sunday);static_assert(wdi.index() == 2); â *end example*]

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L5306)

weekday_indexed is a trivially copyable and standard-layout class type[.](#3.sentence-1)
