From Jason Turner

[time.cal.mwdlast]

Diff to HTML by rtfpessoa

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