From Jason Turner

[time.cal.mwd]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpzqflw90u/{from.md → to.md} +84 -0
tmp/tmpzqflw90u/{from.md → to.md} RENAMED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Class `month_weekday` <a id="time.cal.mwd">[[time.cal.mwd]]</a>
2
+
3
+ #### Overview <a id="time.cal.mwd.overview">[[time.cal.mwd.overview]]</a>
4
+
5
+ ``` cpp
6
+ namespace std::chrono {
7
+ class month_weekday {
8
+ chrono::month m_; // exposition only
9
+ chrono::weekday_indexed wdi_; // exposition only
10
+ public:
11
+ constexpr month_weekday(const chrono::month& m, const chrono::weekday_indexed& wdi) noexcept;
12
+
13
+ constexpr chrono::month month() const noexcept;
14
+ constexpr chrono::weekday_indexed weekday_indexed() const noexcept;
15
+ constexpr bool ok() const noexcept;
16
+ };
17
+ }
18
+ ```
19
+
20
+ `month_weekday` represents the nᵗʰ weekday of a month, of an as yet
21
+ unspecified year. To do this the `month_weekday` stores a `month` and a
22
+ `weekday_indexed`.
23
+
24
+ [*Example 1*:
25
+
26
+ ``` cpp
27
+ constexpr auto mwd
28
+ = February/Tuesday[3]; // mwd is the third Tuesday of February of an as yet unspecified year
29
+ static_assert(mwd.month() == February);
30
+ static_assert(mwd.weekday_indexed() == Tuesday[3]);
31
+ ```
32
+
33
+ — *end example*]
34
+
35
+ `month_weekday` is a trivially copyable and standard-layout class type.
36
+
37
+ #### Member functions <a id="time.cal.mwd.members">[[time.cal.mwd.members]]</a>
38
+
39
+ ``` cpp
40
+ constexpr month_weekday(const chrono::month& m, const chrono::weekday_indexed& wdi) noexcept;
41
+ ```
42
+
43
+ *Effects:* Initializes `m_` with `m`, and `wdi_` with `wdi`.
44
+
45
+ ``` cpp
46
+ constexpr chrono::month month() const noexcept;
47
+ ```
48
+
49
+ *Returns:* `m_`.
50
+
51
+ ``` cpp
52
+ constexpr chrono::weekday_indexed weekday_indexed() const noexcept;
53
+ ```
54
+
55
+ *Returns:* `wdi_`.
56
+
57
+ ``` cpp
58
+ constexpr bool ok() const noexcept;
59
+ ```
60
+
61
+ *Returns:* `m_.ok() && wdi_.ok()`.
62
+
63
+ #### Non-member functions <a id="time.cal.mwd.nonmembers">[[time.cal.mwd.nonmembers]]</a>
64
+
65
+ ``` cpp
66
+ constexpr bool operator==(const month_weekday& x, const month_weekday& y) noexcept;
67
+ ```
68
+
69
+ *Returns:*
70
+ `x.month() == y.month() && x.weekday_indexed() == y.weekday_indexed()`.
71
+
72
+ ``` cpp
73
+ template<class charT, class traits>
74
+ basic_ostream<charT, traits>&
75
+ operator<<(basic_ostream<charT, traits>& os, const month_weekday& mwd);
76
+ ```
77
+
78
+ *Effects:* Equivalent to:
79
+
80
+ ``` cpp
81
+ return os << format(os.getloc(), STATICALLY-WIDEN<charT>("{}/{}"),
82
+ mwd.month(), mwd.weekday_indexed());
83
+ ```
84
+