From Jason Turner

[time.cal.wdidx.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmppmt5hcfj/{from.md → to.md} +39 -0
tmp/tmppmt5hcfj/{from.md → to.md} RENAMED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Overview <a id="time.cal.wdidx.overview">[[time.cal.wdidx.overview]]</a>
2
+
3
+ ``` cpp
4
+ namespace std::chrono {
5
+ class weekday_indexed {
6
+ chrono::weekday wd_; // exposition only
7
+ unsigned char index_; // exposition only
8
+
9
+ public:
10
+ weekday_indexed() = default;
11
+ constexpr weekday_indexed(const chrono::weekday& wd, unsigned index) noexcept;
12
+
13
+ constexpr chrono::weekday weekday() const noexcept;
14
+ constexpr unsigned index() const noexcept;
15
+ constexpr bool ok() const noexcept;
16
+ };
17
+ }
18
+ ```
19
+
20
+ `weekday_indexed` represents a `weekday` and a small index in the range
21
+ 1 to 5. This class is used to represent the first, second, third,
22
+ fourth, or fifth weekday of a month.
23
+
24
+ [*Note 1*: A `weekday_indexed` object can be constructed by indexing a
25
+ `weekday` with an `unsigned`. — *end note*]
26
+
27
+ [*Example 1*:
28
+
29
+ ``` cpp
30
+ constexpr auto wdi = Sunday[2]; // wdi is the second Sunday of an as yet unspecified month
31
+ static_assert(wdi.weekday() == Sunday);
32
+ static_assert(wdi.index() == 2);
33
+ ```
34
+
35
+ — *end example*]
36
+
37
+ `weekday_indexed` is a trivially copyable and standard-layout class
38
+ type.
39
+