tmp/tmpem4iyj8z/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Overview <a id="time.cal.mwd.overview">[[time.cal.mwd.overview]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std::chrono {
|
| 5 |
+
class month_weekday {
|
| 6 |
+
chrono::month m_; // exposition only
|
| 7 |
+
chrono::weekday_indexed wdi_; // exposition only
|
| 8 |
+
public:
|
| 9 |
+
constexpr month_weekday(const chrono::month& m, const chrono::weekday_indexed& wdi) noexcept;
|
| 10 |
+
|
| 11 |
+
constexpr chrono::month month() const noexcept;
|
| 12 |
+
constexpr chrono::weekday_indexed weekday_indexed() const noexcept;
|
| 13 |
+
constexpr bool ok() const noexcept;
|
| 14 |
+
};
|
| 15 |
+
}
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
`month_weekday` represents the nᵗʰ weekday of a month, of an as yet
|
| 19 |
+
unspecified year. To do this the `month_weekday` stores a `month` and a
|
| 20 |
+
`weekday_indexed`.
|
| 21 |
+
|
| 22 |
+
[*Example 1*:
|
| 23 |
+
|
| 24 |
+
``` cpp
|
| 25 |
+
constexpr auto mwd
|
| 26 |
+
= February/Tuesday[3]; // mwd is the third Tuesday of February of an as yet unspecified year
|
| 27 |
+
static_assert(mwd.month() == February);
|
| 28 |
+
static_assert(mwd.weekday_indexed() == Tuesday[3]);
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
— *end example*]
|
| 32 |
+
|
| 33 |
+
`month_weekday` is a trivially copyable and standard-layout class type.
|
| 34 |
+
|